简体   繁体   中英

How do I get a network drive File System object in Java

I'm want to use the getUserPrincipalLookupService in the FileSystem class, but can only seem to get my personal FileSystem through FileSystems.getDefault().

My goal is to set the owner of a file (on the network drive) as a specific user on the network drive.

如果您的网络驱动器映射到H:

FileSystems.getFilesystem(new File("H:\\").toURI())

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM