NativeIntegration
PosixFiles
, WindowsFiles
AbstractFiles
, DefaultPosixFiles
, DefaultWindowsFiles
public interface Files extends NativeIntegration
Modifier and Type | Method | Description |
---|---|---|
List<? extends DirEntry> |
listDir(File dir) |
Lists the entries of the given directory.
|
List<? extends DirEntry> |
listDir(File dir,
boolean linkTarget) |
Lists the entries of the given directory.
|
FileInfo |
stat(File file) |
Returns basic information about the given file.
|
FileInfo |
stat(File file,
boolean linkTarget) |
Returns basic information about the given file.
|
FileInfo stat(File file) throws NativeException
When the file references a symlink, details about the symlink is returned, not the target of the symlink.
file
- The path of the file to get details of. Follows symlinks to the parent directory of this file.FileInfo.Type.Missing
for a file that does not
exist.NativeException
- On failure to query the file information.FilePermissionException
- When the user has insufficient permissions to query the file informationFileInfo stat(File file, boolean linkTarget) throws NativeException
file
- The path of the file to get details of. Follows symlinks to the parent directory of this file.linkTarget
- When true and the file is a symlink, return details of the target of the symlink instead of details of the symlink itself.FileInfo.Type.Missing
for a file that does not
exist.NativeException
- On failure to query the file information.FilePermissionException
- When the user has insufficient permissions to query the file informationList<? extends DirEntry> listDir(File dir) throws NativeException
When a directory entry is a symlink, details about the symlink is returned, not the target of the symlink.
dir
- The path of the directory to list. Follows symlinks to this directory.NativeException
- On failure.NoSuchFileException
- When the specified directory does not exist.NotADirectoryException
- When the specified file is not a directory.FilePermissionException
- When the user has insufficient permissions to list the entriesList<? extends DirEntry> listDir(File dir, boolean linkTarget) throws NativeException
dir
- The path of the directory to list. Follows symlinks to this directory.linkTarget
- When true and a directory entry is a symlink, return details of the target of the symlink instead of details of the symlink itself.NativeException
- On failure.NoSuchFileException
- When the specified directory does not exist.NotADirectoryException
- When the specified file is not a directory.FilePermissionException
- When the user has insufficient permissions to list the entries