Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何使用Java测试文件是否属于用户或操作系统?我对找出操作系统生成的用于执行删除或修改等操作的临时文件特别感兴趣。
tks。
在 Java 7 中,您可以使用 Files.getOwner()
http://docs.oracle.com/javase/7/docs/api/java/nio/file/Files.html#getOwner%28java.nio.file.Path,%20java.nio.file.LinkOption...% 29