/** * 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 delete(File dir) { // Log failure by default return delete(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); }
/** * Expand the specified input stream into the specified directory, creating * a file named from the specified relative path. * * @param input InputStream to be copied * @param docBase Document base directory into which we are expanding * @param name Relative pathname of the file to be created * * @exception IOException if an input/output error occurs */ protected void expand(InputStream input, File docBase, String name) throws IOException { ExpandWar.expand(input,docBase,name); }
docBase = ExpandWar.expand(host, war, pathName); file = new File(docBase); docBase = file.getCanonicalPath(); URL war = new URL("jar:" + (new File (docBase)).toURI().toURL() + "!/"); ExpandWar.validate(host, war, pathName); } else { File docDir = new File(docBase); new URL("jar:" + warFile.toURI().toURL() + "!/"); if (unpackWARs) { docBase = ExpandWar.expand(host, war, pathName); file = new File(docBase); docBase = file.getCanonicalPath(); } else { docBase = warFile.getCanonicalPath(); ExpandWar.validate(host, war, pathName);
File fileDest = new File(dest, files[i]); if (fileSrc.isDirectory()) { result = copy(fileSrc, fileDest); } else { try (FileChannel ic = (new FileInputStream(fileSrc)).getChannel();
docBase = ExpandWar.expand(host, war, pathName); file = new File(docBase); docBase = file.getCanonicalPath(); URL war = new URL("jar:" + (new File (docBase)).toURI().toURL() + "!/"); ExpandWar.validate(host, war, pathName); } else { File docDir = new File(docBase); new URL("jar:" + warFile.toURI().toURL() + "!/"); if (unpackWARs) { docBase = ExpandWar.expand(host, war, pathName); file = new File(docBase); docBase = file.getCanonicalPath(); } else { docBase = warFile.getCanonicalPath(); ExpandWar.validate(host, war, pathName);
File fileDest = new File(dest, files[i]); if (fileSrc.isDirectory()) { result = copy(fileSrc, fileDest); } else { FileChannel ic = null;
/** * 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 delete(File dir) { // Log failure by default return delete(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); }
docBase = ExpandWar.expand(host, war, pathName); file = new File(docBase); docBase = file.getCanonicalPath(); URL war = new URL("jar:" + (new File (docBase)).toURI().toURL() + "!/"); ExpandWar.validate(host, war, pathName); } else { File docDir = new File(docBase); new URL("jar:" + warFile.toURI().toURL() + "!/"); if (unpackWARs) { docBase = ExpandWar.expand(host, war, pathName); file = new File(docBase); docBase = file.getCanonicalPath(); } else { docBase = warFile.getCanonicalPath(); ExpandWar.validate(host, war, pathName);
File fileDest = new File(dest, files[i]); if (fileSrc.isDirectory()) { result = copy(fileSrc, fileDest); } else { try (FileChannel ic = (new FileInputStream(fileSrc)).getChannel();
/** * Expand the WAR file found at the specified URL into an unpacked * directory structure, and return the absolute pathname to the expanded * directory. * * @param war URL of the web application archive to be expanded * (must start with "jar:") * * @exception IllegalArgumentException if this is not a "jar:" URL * @exception IOException if an input/output error was encountered * during expansion */ protected String expand(URL war) throws IOException { return ExpandWar.expand(host,war); }