/** * Returns the comment set for the Zip file * @return String * @throws ZipException */ public String getComment() throws ZipException { return getComment(null); }
/** * Extracts all the files in the given zip file to the input destination path. * If zip file does not exist or destination path is invalid then an * exception is thrown. * @param destPath * @throws ZipException */ public void extractAll(String destPath) throws ZipException { extractAll(destPath, null); }
/** * Extracts a specific file from the zip file to the destination path. * If destination path is invalid, then this method throws an exception. * @param fileHeader * @param destPath * @throws ZipException */ public void extractFile(FileHeader fileHeader, String destPath) throws ZipException { extractFile(fileHeader, destPath, null); }
public static void unzipAllFile(File zip, String dir) throws Exception { ZipFile zipFile = new ZipFile(zip); zipFile.setFileNameCharset("utf-8"); zipFile.extractAll(dir); }
/** * 解压zip格式压缩包 */ public static void unzip(String sourceZip, String destDir) throws Exception { ZipFile zipFile = new ZipFile(sourceZip); zipFile.extractAll(destDir); }
/** * Creates a zip file and adds the list of source file(s) to the zip file. If the zip file * exists then this method throws an exception. Parameters such as compression type, etc * can be set in the input parameters * @param sourceFileList - File to be added to the zip file * @param parameters - parameters to create the zip file * @throws ZipException */ public void createZipFile(ArrayList sourceFileList, ZipParameters parameters) throws ZipException { createZipFile(sourceFileList, parameters, false, -1); }
/** * Reads all the header information for the zip file. * <br><br><b>Note:</b> This method does not read local file header information * @return {@link ZipModel} * @throws ZipException */ public ZipModel readAllHeaders() throws ZipException { return readAllHeaders(null); }
public void close() throws IOException { if (outputStream != null) outputStream.close(); }
public void seek(long pos) throws IOException { raf.seek(pos); }
public long getFilePointer() throws IOException { return raf.getFilePointer(); }
public NativeFile read() throws FileNotFoundException { return new NativeFile(f, "r"); }
/** * Unzip it * * @param zipFile input zip file * @param outputFolder zip file output folder */ private void unZipIt(String zipFile, String outputFolder) throws ZipException { ZipFile zip = new ZipFile(zipFile); zip.extractAll(outputFolder); }
/** * Extracts all the files in the given zip file to the input destination path. * If zip file does not exist or destination path is invalid then an * exception is thrown. * @param destPath * @throws ZipException */ public void extractAll(String destPath) throws ZipException { extractAll(destPath, null); }
/** * Extracts a specific file from the zip file to the destination path. * If destination path is invalid, then this method throws an exception. * @param fileHeader * @param destPath * @throws ZipException */ public void extractFile(FileHeader fileHeader, String destPath) throws ZipException { extractFile(fileHeader, destPath, null); }
/** * Returns the comment set for the Zip file * @return String * @throws ZipException */ public String getComment() throws ZipException { return getComment(null); }
/** * Creates a zip file and adds the list of source file(s) to the zip file. If the zip file * exists then this method throws an exception. Parameters such as compression type, etc * can be set in the input parameters * @param sourceFileList - File to be added to the zip file * @param parameters - parameters to create the zip file * @throws ZipException */ public void createZipFile(ArrayList sourceFileList, ZipParameters parameters) throws ZipException { createZipFile(sourceFileList, parameters, false, -1); }
/** * Reads all the header information for the zip file. * <br><br><b>Note:</b> This method does not read local file header information * @return {@link ZipModel} * @throws ZipException */ public ZipModel readAllHeaders() throws ZipException { return readAllHeaders(null); }
public void close() throws IOException { if (raf != null) raf.close(); }
public void seek(long pos) throws IOException { raf.seek(pos); }
public void close() throws IOException { raf.close(); }