List of utility methods to do File Exist
boolean | fileExistsAndCanRead(final String filePath) Shortcut method to determine if a file object can actually be "read" as a file return fileExistsAndCanRead(new File(filePath)); |
boolean | fileExistsAndIsExecutable(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; |
boolean | fileExistsAndReadable(String file) Checks file existence File f = new File(file); boolean res = (!f.isFile() || !f.canRead()) ? false : true; return res; |
boolean | fileExistsAndReadable(String sourcePath) file Exists And Readable if (sourcePath == null) { return false; final File f = new File(sourcePath); return fileExistsAndReadable(f); |
boolean | FileExistsNotEmpty(String filename) File Exists Not Empty File file = new File(filename); if (!file.exists()) return false; if (file.length() <= 0) return false; return true; |
boolean | isFileExist(File file) is File Exist return file.exists();
|
boolean | isFileExist(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; ... |
boolean | isFileExist(final String filePathString) is File Exist File f = new File(filePathString); return f.exists(); |
boolean | isFileExist(String assetDestinationLocation, String id, String assetId) Checks if is file exist. String filePath = assetDestinationLocation + "/" + id + "/" + assetId + ".xml"; return (new File(filePath).isFile()); |
boolean | isFileExist(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; |