[Lutinutil-commits] r1456 - lutinutil/trunk/src/main/java/org/codelutin/util
Author: chatellier Date: 2009-04-30 12:26:16 +0000 (Thu, 30 Apr 2009) New Revision: 1456 Modified: lutinutil/trunk/src/main/java/org/codelutin/util/ZipUtil.java Log: Add doc on md5 parameter. Add new zip method with null default filter value. Modified: lutinutil/trunk/src/main/java/org/codelutin/util/ZipUtil.java =================================================================== --- lutinutil/trunk/src/main/java/org/codelutin/util/ZipUtil.java 2009-04-30 12:16:04 UTC (rev 1455) +++ lutinutil/trunk/src/main/java/org/codelutin/util/ZipUtil.java 2009-04-30 12:26:16 UTC (rev 1456) @@ -143,10 +143,10 @@ * @param includes the files to include in zip * @throws java.io.IOException if any problem while compressing */ - static public void compressFiles(File zipFile, File root, Collection<File> includes) throws IOException { + public static void compressFiles(File zipFile, File root, Collection<File> includes) throws IOException { compressFiles(zipFile, root, includes, false); } - + /** * Compress 'includes' files in zipFile. If file in includes is directory * only the directory is put in zipFile, not the file contained in directory @@ -202,7 +202,7 @@ } /** - * if fileOrDirectory is directory Compress recursively all file in this + * If fileOrDirectory is directory Compress recursively all file in this * directory, else if is just file compress one file. * <p/> * Entry result name in zip start at fileOrDirectory. @@ -210,15 +210,30 @@ * * @param zipFile the source zip file * @param fileOrDirectory the file or directory to compress + * @throws IOException if any problem while compressing + */ + public static void compress(File zipFile, File fileOrDirectory) throws IOException { + compress(zipFile, fileOrDirectory, null, false); + } + + /** + * If fileOrDirectory is directory Compress recursively all file in this + * directory, else if is just file compress one file. + * <p/> + * Entry result name in zip start at fileOrDirectory. + * example: if we compress /etc/apache, entry will be apache/http.conf, ... + * + * @param zipFile the source zip file + * @param fileOrDirectory the file or directory to compress * @param filter used to accept file, if null, all file is accepted * @throws IOException if any problem while compressing */ - static public void compress(File zipFile, File fileOrDirectory, FileFilter filter) throws IOException { + public static void compress(File zipFile, File fileOrDirectory, FileFilter filter) throws IOException { compress(zipFile, fileOrDirectory, filter, false); } /** - * if fileOrDirectory is directory Compress recursively all file in this + * If fileOrDirectory is directory Compress recursively all file in this * directory, else if is just file compress one file. * <p/> * Entry result name in zip start at fileOrDirectory. @@ -227,9 +242,10 @@ * @param zipFile the source zip file * @param fileOrDirectory the file or directory to compress * @param filter used to accept file, if null, all file is accepted + * @param createMD5 also create a MD5 file (zip name + .md5). MD5 file is created after zip. * @throws IOException if any problem while compressing */ - static public void compress(File zipFile, File fileOrDirectory, FileFilter filter, boolean createMD5) throws IOException { + public static void compress(File zipFile, File fileOrDirectory, FileFilter filter, boolean createMD5) throws IOException { if (filter == null) { filter = ALL_FILE_FILTER; }
participants (1)
-
chatellierï¼ users.labs.libre-entreprise.org