List of utility methods to do File Path Delete
void | deleteFolder(String path) delete Folder deleteFolder(new File(path));
|
boolean | deleteFolder(String path) Delete all files and folders in the directory. boolean flag = true; File dirFile = new File(path); if (!dirFile.isDirectory()) { return flag; File[] files = dirFile.listFiles(); for (File file : files) { if (file.isFile()) { ... |
int | deleteFolder(String path) deleteFolder int res = 1; File dir = new File(path); String[] files = dir.list(); if (files != null && files.length > 0) { for (int i = 0; i < files.length; i++) { File temp = new File(path + "/" + files[i]); if (temp.isDirectory()) { res += deleteFolder(temp.getAbsolutePath()); ... |
boolean | deleteFolder(String path) delete Folder if (path != null && storageReady()) { File dir = new File(path); if (dir.exists() && dir.isDirectory()) { File[] files = dir.listFiles(); for (File file : files) { if (!file.delete()) { return dir.delete(); } else { return false; |
void | deleteFolder(String pathToRootFolder) delete Folder File rootFolder = new File(pathToRootFolder);
deleteFolder(rootFolder);
|
void | deleteFolder(String pFolderPath) delete Folder File file = new File(pFolderPath); file.delete(); for (int i = 0; file != null && file.isDirectory() && i < file.listFiles().length; i++) { deleteFolder(file.listFiles()[i].getAbsolutePath()); file.delete(); file.delete(); |
boolean | deleteFolder(String sPath) delete Folder boolean flag = false; File file = new File(sPath); if (!file.exists()) { return flag; } else { if (file.isFile()) { return deleteFile(sPath); } else { ... |
void | deleteFolderAndContent(String folderPath) Function that deletes a folder and its content. File index = new File(folderPath); String[] entries = index.list(); for (String s : entries) { File currentFile = new File(index.getPath(), s); currentFile.delete(); index.delete(); |
boolean | deleteFolderRec(File path, boolean alsoDeleteGivenFolder) This function will recursively delete directories and files. boolean ok; if (path.exists()) { ok = true; if (path.isDirectory()) { File[] files = path.listFiles(); for (int i = 0; i < files.length; i++) { if (files[i].isDirectory()) { deleteFolderRec(files[i], true); ... |
void | deleteFolderRecursively(File path, boolean includeSelf) Deletes directory at path recursively. if (!path.isDirectory()) throw new IllegalArgumentException("The passed file is not a directory."); File[] files = path.listFiles(); if (files == null) return; for (int i = 0; i < files.length; i++) { File f = files[i]; if (f.isFile()) { ... |