metadata
Retrieves metadata for a given file or directory path.
The method determines whether the provided path represents a regular file or directory, and constructs the metadata accordingly. If the path does not represent a regular file or directory, it returns null.
Return
A FileMetadata instance containing information about the file or directory, or null if the path does not represent a valid file or directory.
Parameters
path
The path for which the metadata is to be retrieved.