For what it is worth, "line count" is not a file attribute in UNIX or Linux.
If you want a line count (assuming that it is a valid concept) you need to figure it out by reading the file. Simply counting newline characters gives a roughly correct answer for "text" files, but it may give a bogus answer in other cases. A complete answer involves:
- determining the file's type,
- deciding whether "line count" makes sense for the file type,
- deciding whether to count the lines or retrieve a line count from the file's internal metadata, and
- (if necessary) counting the lines in a way that is appropriate to the file type.
The other attributes you listed (file size and modification time) can be accessed in Java using the classic java.io.File
API, or the new Java 7 java.nio.file.Files
API.