Java Utililty Methods File Exist

List of utility methods to do File Exist

Description

The list of methods to do File Exist are organized into topic(s).

Method

booleanfileExistsAndCanRead(final String filePath)
Shortcut method to determine if a file object can actually be "read" as a file
return fileExistsAndCanRead(new File(filePath));
booleanfileExistsAndIsExecutable(String filePathString)
check that the given path exists, is readable and can be executed
File f = new File(filePathString);
boolean result = f.exists() && f.canRead() && f.canExecute();
return result;
booleanfileExistsAndReadable(String file)
Checks file existence
File f = new File(file);
boolean res = (!f.isFile() || !f.canRead()) ? false : true;
return res;
booleanfileExistsAndReadable(String sourcePath)
file Exists And Readable
if (sourcePath == null) {
    return false;
final File f = new File(sourcePath);
return fileExistsAndReadable(f);
booleanFileExistsNotEmpty(String filename)
File Exists Not Empty
File file = new File(filename);
if (!file.exists())
    return false;
if (file.length() <= 0)
    return false;
return true;
booleanisFileExist(File file)
is File Exist
return file.exists();
booleanisFileExist(File file, File folder)
is File Exist
File[] files = folder.listFiles();
String fileName = file.getName();
for (File f : files) {
    if (fileName.equals(f.getName())) {
        return true;
return false;
...
booleanisFileExist(final String filePathString)
is File Exist
File f = new File(filePathString);
return f.exists();
booleanisFileExist(String assetDestinationLocation, String id, String assetId)
Checks if is file exist.
String filePath = assetDestinationLocation + "/" + id + "/" + assetId + ".xml";
return (new File(filePath).isFile());
booleanisFileExist(String file)
isFileExist method check file existance
File f = new File(file);
if (f == null)
    return false;
if (f.exists() && !f.isDirectory())
    return true;
else
    return false;