/** * Delete the specified directory, including all of its contents and * sub-directories recursively. Any failure will be logged. * * @param dir File object representing the directory to be deleted */ public static boolean deleteDir(File dir) { return deleteDir(dir, true); }
/** * Delete the specified directory, including all of its contents and * sub-directories recursively. Any failure will be logged. * * @param dir File object representing the directory to be deleted */ public static boolean deleteDir(File dir) { return deleteDir(dir, true); }
/** * Delete the specified directory, including all of its contents and * sub-directories recursively. Any failure will be logged. * * @param dir File object representing the directory to be deleted */ public static boolean deleteDir(File dir) { return deleteDir(dir, true); }
/** * Delete the specified directory, including all of its contents and * sub-directories recursively. Any failure will be logged. * * @param dir File object representing the directory to be deleted */ public static boolean deleteDir(File dir) { return deleteDir(dir, true); }
/** * Delete the specified directory, including all of its contents and * sub-directories recursively. Any failure will be logged. * * @param dir File object representing the directory to be deleted * @return <code>true</code> if the deletion was successful */ public static boolean deleteDir(File dir) { return deleteDir(dir, true); }
/** * Delete the specified directory, including all of its contents and * sub-directories recursively. Any failure will be logged. * * @param dir File object representing the directory to be deleted */ public static boolean deleteDir(File dir) { return deleteDir(dir, true); }
/** * Delete the specified directory, including all of its contents and * sub-directories recursively. Any failure will be logged. * * @param dir File object representing the directory to be deleted */ public static boolean deleteDir(File dir) { return deleteDir(dir, true); }
/** * Delete the specified directory, including all of its contents and * sub-directories recursively. Any failure will be logged. * * @param dir File object representing the directory to be deleted */ public static boolean deleteDir(File dir) { return deleteDir(dir, true); }
/** * Delete the specified directory, including all of its contents and * sub-directories recursively. Any failure will be logged. * * @param dir File object representing the directory to be deleted * @return <code>true</code> if the deletion was successful */ public static boolean deleteDir(File dir) { return deleteDir(dir, true); }
/** * Delete the specified directory, including all of its contents and * sub-directories recursively. Any failure will be logged. * * @param dir File object representing the directory to be deleted */ public static boolean deleteDir(File dir) { return deleteDir(dir, true); }
/** * Delete the specified directory, including all of its contents and * sub-directories recursively. Any failure will be logged. * * @param dir File object representing the directory to be deleted */ public static boolean deleteDir(File dir) { return deleteDir(dir, true); }
/** * Delete the specified directory, including all of its contents and * subdirectories recursively. * * @param dir File object representing the directory to be deleted */ public static boolean delete(File dir) { if (dir.isDirectory()) { return deleteDir(dir); } else { return dir.delete(); } }
/** * Delete the specified directory, including all of its contents and * subdirectories recursively. * * @param dir File object representing the directory to be deleted */ public static boolean deleteDir(File dir) { String files[] = dir.list(); if (files == null) { files = new String[0]; } for (int i = 0; i < files.length; i++) { File file = new File(dir, files[i]); if (file.isDirectory()) { deleteDir(file); } else { file.delete(); } } return dir.delete(); }
/** * Delete the specified directory, including all of its contents and * sub-directories recursively. * * @param dir File object representing the directory to be deleted * @param logFailure <code>true</code> if failure to delete the resource * should be logged */ public static boolean delete(File dir, boolean logFailure) { boolean result; if (dir.isDirectory()) { result = deleteDir(dir, logFailure); } else { if (dir.exists()) { result = dir.delete(); } else { result = true; } } if (logFailure && !result) { log.log(Level.SEVERE, LogFacade.DELETE_DIR_EXCEPTION, dir.getAbsolutePath()); } return result; }
/** * Make sure an the unpacked WAR is not left behind * you would think Tomcat would cleanup an unpacked WAR, but it doesn't */ @Override public void deleteUnpackedWAR(StandardContext standardContext) { File unpackDir = new File(standardHost.getAppBase(), standardContext.getPath().substring(1)); if (unpackDir.exists()) { ExpandWar.deleteDir(unpackDir); } }
/** * Delete the specified directory, including all of its contents and * sub-directories recursively. * * @param dir File object representing the directory to be deleted * @param logFailure <code>true</code> if failure to delete the resource * should be logged */ public static boolean delete(File dir, boolean logFailure) { boolean result; if (dir.isDirectory()) { result = deleteDir(dir, logFailure); } else { if (dir.exists()) { result = dir.delete(); } else { result = true; } } if (logFailure && !result) { CatalinaLogger.STARTUP_LOGGER.fileDeleteError(dir.getAbsolutePath()); } return result; }
/** * Delete the specified directory, including all of its contents and * sub-directories recursively. * * @param dir File object representing the directory to be deleted * @param logFailure <code>true</code> if failure to delete the resource * should be logged */ public static boolean delete(File dir, boolean logFailure) { boolean result; if (dir.isDirectory()) { result = deleteDir(dir, logFailure); } else { if (dir.exists()) { result = dir.delete(); } else { result = true; } } if (logFailure && !result) { log.error(sm.getString( "expandWar.deleteFailed", dir.getAbsolutePath())); } return result; }
/** * Delete the specified directory, including all of its contents and * sub-directories recursively. * * @param dir File object representing the directory to be deleted * @param logFailure <code>true</code> if failure to delete the resource * should be logged * @return <code>true</code> if the deletion was successful */ public static boolean delete(File dir, boolean logFailure) { boolean result; if (dir.isDirectory()) { result = deleteDir(dir, logFailure); } else { if (dir.exists()) { result = dir.delete(); } else { result = true; } } if (logFailure && !result) { log.error(sm.getString( "expandWar.deleteFailed", dir.getAbsolutePath())); } return result; }
/** * Delete the specified directory, including all of its contents and * sub-directories recursively. * * @param dir File object representing the directory to be deleted * @param logFailure <code>true</code> if failure to delete the resource * should be logged */ public static boolean delete(File dir, boolean logFailure) { boolean result; if (dir.isDirectory()) { result = deleteDir(dir, logFailure); } else { if (dir.exists()) { result = dir.delete(); } else { result = true; } } if (logFailure && !result) { log.error(sm.getString( "expandWar.deleteFailed", dir.getAbsolutePath())); } return result; }
/** * Make sure the WAR file and unpacked directory (if applicable) are not left behind. * * @see {@link TomcatEmbeddedConfiguration#isUnpackArchive()} */ private void deleteWar(final Archive<?> archive) { if (configuration.isUnpackArchive()) { final ContextName contextName = getContextName(archive); final File unpackDir = new File(host.getAppBase(), contextName.getBaseName()); if (unpackDir.exists()) { ExpandWar.deleteDir(unpackDir); } } final File warFile = new File(host.getAppBase(), archive.getName()); if (warFile.exists()) { warFile.delete(); } }