use of net.lingala.zip4j.core.ZipFile in project bamboobsc by billchen198318.
the class PdcaReportExcelCommand method createZipFile.
private String createZipFile(List<SysUploadVO> uploads) throws Exception {
ZipFile zip = new ZipFile(Constants.getWorkTmpDir() + SimpleUtils.getUUIDStr() + ".zip");
ZipParameters parameters = new ZipParameters();
parameters.setCompressionMethod(Zip4jConstants.COMP_DEFLATE);
parameters.setCompressionLevel(Zip4jConstants.DEFLATE_LEVEL_NORMAL);
for (SysUploadVO reportUpload : uploads) {
zip.addFile(UploadSupportUtils.getRealFile(reportUpload.getOid()), parameters);
}
return UploadSupportUtils.create(Constants.getSystem(), UploadTypes.IS_TEMP, false, zip.getFile(), "pdca-report.zip");
}
use of net.lingala.zip4j.core.ZipFile in project project-build-plugin by axonivy.
the class InstallEngineMojo method unpackEngine.
private void unpackEngine(File downloadZip) throws MojoExecutionException {
try {
String targetLocation = getRawEngineDirectory().getAbsolutePath();
getLog().info("Unpacking engine " + downloadZip.getAbsolutePath() + " to " + targetLocation);
ZipFile engineZip = new ZipFile(downloadZip);
engineZip.extractAll(targetLocation);
} catch (ZipException ex) {
throw new MojoExecutionException("Failed to unpack downloaded engine '" + downloadZip + "'.", ex);
}
}
use of net.lingala.zip4j.core.ZipFile in project project-build-plugin by axonivy.
the class TestInstallEngineMojo method createFakeEngineZip.
private static File createFakeEngineZip(String ivyVersion) throws IOException, ZipException {
File zipDir = createFakeEngineDir(ivyVersion);
File zipFile = new File(zipDir, "fake.zip");
ZipFile zip = new ZipFile(zipFile);
zip.createZipFileFromFolder(new File(zipDir, OsgiDir.INSTALL_AREA), new ZipParameters(), false, 0);
return zipFile;
}
use of net.lingala.zip4j.core.ZipFile in project leopard by tanhaichao.
the class ZipUtil method unzip.
/**
* 解压zip格式压缩包
*/
public static void unzip(String sourceZip, String destDir) throws Exception {
ZipFile zipFile = new ZipFile(sourceZip);
zipFile.extractAll(destDir);
}
use of net.lingala.zip4j.core.ZipFile in project apex-core by apache.
the class StramTestSupport method createConfigPackageFile.
/**
* Create an confPackage zip using the sample confPackage located in
* src/test/resources/testConfPackage/testConfPackageSrc.
*
* @param file The file whose path will be used to create the confPackage zip
* @return The File object that can be used in the ConfigPackage constructor.
* @throws net.lingala.zip4j.exception.ZipException
*/
public static File createConfigPackageFile(File file) throws net.lingala.zip4j.exception.ZipException {
ZipFile zipFile = new ZipFile(file);
ZipParameters zipParameters = new ZipParameters();
zipParameters.setIncludeRootFolder(false);
zipFile.createZipFileFromFolder("src/test/resources/testConfigPackage/testConfigPackageSrc", zipParameters, false, Long.MAX_VALUE);
return file;
}
Aggregations