Vivek Srivastava
Vivek Srivastava

Reputation: 1

How to find last modified user name of a file through java

I am trying to print the user name who modified the file contents. I had tried Files.owner but it gives the system name instead of the owner name. But unable to get it. Please help ...

Upvotes: 0

Views: 499

Answers (1)

Stephen C
Stephen C

Reputation: 718936

I can't think of any mainstream operating system that records who last modified a file in the file's intrinsic metadata. Certainly, none of the standard FileAttributeView subclasses expose this information.

Many operating system provide fine-grained file system audit. If your application had sufficient privilege, it could (in theory) read the audit logs and search for the last change event for the file of interest. However, this would be non-portable, and VERY expensive. I would not view this as a practical solution.

Upvotes: 1

Related Questions