Search in sources :

Example 16 with ZipFile

use of net.lingala.zip4j.core.ZipFile in project grakn by graknlabs.

the class DistributionContext method unzipDistribution.

private void unzipDistribution() throws ZipException {
    // Unzip the distribution
    ZipFile zipped = new ZipFile(ZIP_FULLPATH.toFile());
    zipped.extractAll(TARGET_DIRECTORY.toAbsolutePath().toString());
}
Also used : ZipFile(net.lingala.zip4j.core.ZipFile)

Example 17 with ZipFile

use of net.lingala.zip4j.core.ZipFile in project ArachneCentralAPI by OHDSI.

the class AnalysisHelper method compressAndSplit.

public void compressAndSplit(ArrayList<File> files, File zipArchive) {
    try {
        ZipFile zipFile = new ZipFile(zipArchive.getAbsoluteFile());
        ZipParameters parameters = new ZipParameters();
        parameters.setCompressionMethod(Zip4jConstants.COMP_DEFLATE);
        parameters.setCompressionLevel(Zip4jConstants.DEFLATE_LEVEL_NORMAL);
        zipFile.createZipFile(files, parameters, true, maximumSize);
    } catch (ZipException ex) {
        LOGGER.error(ex.getMessage(), ex);
        throw new ConverterRuntimeException(ex.getMessage());
    }
}
Also used : ZipFile(net.lingala.zip4j.core.ZipFile) ZipException(net.lingala.zip4j.exception.ZipException) ConverterRuntimeException(com.odysseusinc.arachne.portal.exception.ConverterRuntimeException) ZipParameters(net.lingala.zip4j.model.ZipParameters)

Aggregations

ZipFile (net.lingala.zip4j.core.ZipFile)17 ZipParameters (net.lingala.zip4j.model.ZipParameters)9 File (java.io.File)8 IOException (java.io.IOException)5 ZipException (net.lingala.zip4j.exception.ZipException)4 BinaryContent (ddf.catalog.data.BinaryContent)2 Result (ddf.catalog.data.Result)2 CatalogTransformerException (ddf.catalog.transform.CatalogTransformerException)2 Instant (java.time.Instant)2 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 List (java.util.List)2 ServiceException (com.netsteadfast.greenstep.base.exception.ServiceException)1 SysUploadVO (com.netsteadfast.greenstep.vo.SysUploadVO)1 ConverterRuntimeException (com.odysseusinc.arachne.portal.exception.ConverterRuntimeException)1 StorageException (ddf.catalog.content.StorageException)1 StorageProvider (ddf.catalog.content.StorageProvider)1 ContentItem (ddf.catalog.content.data.ContentItem)1 DeleteStorageRequestImpl (ddf.catalog.content.operation.impl.DeleteStorageRequestImpl)1 DeletedMetacard (ddf.catalog.core.versioning.DeletedMetacard)1