-
February 1st, 2012, 12:10 AM
#1
file owner's name in java
using jdk 1.7 how can I retrieve the owner's name of a file. piece of code is as follows.getting error
cannot find FileRef and Attributes class.
FileRef file=Paths.get("name and location of file with extension");
UserPrincipal principal=Attributes.getOwner(file);
System.out.println("File's owner is "+principal.getName());
if there is some other method to get file owner's name then please suggest. I would be great with an example
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|