List of utility methods to do Zip Unzip File
void | gUnzip(File srcFile, File destFile) GUnzips a source File to a destination File. FileOutputStream fos = null; GZIPInputStream zIn = null; InputStream fis = null; try { fos = new FileOutputStream(destFile); fis = new FileInputStream(srcFile); zIn = new GZIPInputStream(fis); copy(zIn, fos); ... |
void | unJarDirectory(final String in, final File fOut) un Jar Directory if (!fOut.exists()) { fOut.mkdirs(); if (!fOut.isDirectory()) { throw new IOException("Destination must be a directory."); if (logger.isDebugEnabled()) { logger.debug("Extracting Grinder Analyzer to " + fOut.getPath() ... |
Vector | unzip(File pZipFile) unzip File lTempDir = createTempDir();
return unzipDirectory(lTempDir, pZipFile);
|
List | unzip(String sourceFileName, String destPath) unzip if (sourceFileName.endsWith(".zip")) { ZipFile zf = new ZipFile(sourceFileName); Enumeration en = zf.entries(); List v = new ArrayList(); while (en.hasMoreElements()) { ZipEntry zipEnt = (ZipEntry) en.nextElement(); saveEntry(destPath, zipEnt, zf); if (!zipEnt.isDirectory()) { ... |
boolean | zip(String filePath, String zipPath) zip try { File file = new File(filePath); BufferedInputStream bis = null; FileOutputStream fos = new FileOutputStream(zipPath); ZipOutputStream zos = new ZipOutputStream( new BufferedOutputStream(fos)); if (file.isDirectory()) { int baseLength = file.getParent().length() + 1; ... |
void | zip(String sourceDir, String zipFile) zip ZipOutputStream zos = null; try { zos = new ZipOutputStream(new BufferedOutputStream( new FileOutputStream(zipFile))); File file = new File(sourceDir); String basePath = null; if (file.isDirectory()) { basePath = file.getPath(); ... |
void | zip(String[] files, String destZipFilePath) Compresses files represented in an array of paths List<File> listFiles = new ArrayList<File>(); for (int i = 0; i < files.length; i++) { listFiles.add(new File(files[i])); zip(listFiles, destZipFilePath); |
void | zip(String[] files, String zipFile) zip BufferedInputStream origin = null; ZipOutputStream out = new ZipOutputStream(new BufferedOutputStream( new FileOutputStream(zipFile))); try { byte data[] = new byte[BUFFER_SIZE]; for (int i = 0; i < files.length; i++) { FileInputStream fi = new FileInputStream(files[i]); origin = new BufferedInputStream(fi, BUFFER_SIZE); ... |
void | zip(String[] files, String zipFile) zip BufferedInputStream origin = null; ZipOutputStream out = new ZipOutputStream(new BufferedOutputStream( new FileOutputStream(zipFile))); try { byte data[] = new byte[BUFFER_SIZE]; for (int i = 0; i < files.length; i++) { FileInputStream fi = new FileInputStream(files[i]); origin = new BufferedInputStream(fi, BUFFER_SIZE); ... |
void | zip(String[] files, String zipFile) zip BufferedInputStream origin = null; ZipOutputStream out = new ZipOutputStream(new BufferedOutputStream( new FileOutputStream(zipFile))); try { byte data[] = new byte[BUFFER_SIZE]; for (int i = 0; i < files.length; i++) { FileInputStream fi = new FileInputStream(files[i]); origin = new BufferedInputStream(fi, BUFFER_SIZE); ... |