mirror of
https://github.com/nix-community/nix-on-droid-app.git
synced 2025-12-09 02:21:11 +01:00
Added: Add FileUtils.regularOrDirectoryFileExists()
This commit is contained in:
parent
5b2aca9cf7
commit
aed4b96a31
1 changed files with 14 additions and 0 deletions
|
|
@ -220,6 +220,20 @@ public class FileUtils {
|
||||||
return getFileType(filePath, false) == FileType.SYMLINK;
|
return getFileType(filePath, false) == FileType.SYMLINK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks whether a regular or directory file exists at {@code filePath}.
|
||||||
|
*
|
||||||
|
* @param filePath The {@code path} for regular file to check.
|
||||||
|
* @param followLinks The {@code boolean} that decides if symlinks will be followed while
|
||||||
|
* finding if file exists. Check {@link #getFileType(String, boolean)}
|
||||||
|
* for details.
|
||||||
|
* @return Returns {@code true} if regular or directory file exists, otherwise {@code false}.
|
||||||
|
*/
|
||||||
|
public static boolean regularOrDirectoryFileExists(final String filePath, final boolean followLinks) {
|
||||||
|
FileType fileType = getFileType(filePath, followLinks);
|
||||||
|
return fileType == FileType.REGULAR || fileType == FileType.DIRECTORY;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks whether any file exists at {@code filePath}.
|
* Checks whether any file exists at {@code filePath}.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue