Android 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

booleanexists(String path)
exists
return new File(path).exists();
BooleanfileExists(String path)
file Exists
return new File(path).isFile();
BooleanfileOrPathExists(String path)
file Or Path Exists
File f = new File(path);
return f.exists();
FilegetExistingFile(String path, boolean mustBeReadable, boolean mustBeWritable, boolean isDirectory)
gets a file that exists and matches the requested permissions or throws an exception checks if it s a file or a directory
File file = getExistingFile(path, mustBeReadable, mustBeWritable);
if (file.isDirectory() && !isDirectory)
    throw new IOException(file.getAbsolutePath()
            + " exists but is not a file");
if (!file.isDirectory() && isDirectory)
    throw new IOException(file.getAbsolutePath()
            + " exists but is not a directory");
return file;
...
booleanisExist(String path)
is Exist
return new File(path).exists();
booleanisFileExist(String fileName)
is File Exist
File file = new File(fileName);
return file.exists();
booleanisFileExist(String fileName)
is File Exist
boolean bool = false;
bool = new File(fileName).exists();
return bool;
booleanisFileExist(String folder, String fileName)
is File Exist
boolean bool = false;
bool = new File(folder, fileName).exists();
return bool;
booleanisFileExist(String path)
is File Exist
File temp = new File(path);
return temp.exists();
booleanisFileExist(String path)
is File Exist
boolean exist = false;
if (path != null) {
    File f = new File(path);
    exist = f.exists();
return exist;