Package net.lingala.zip4j.core

Examples of net.lingala.zip4j.core.ZipFile.addFile()


      // Add the reference file to the zip file.
      ZipFile zipFile = new ZipFile(file);
      ZipParameters parameters = new ZipParameters();
      parameters.setCompressionMethod(Zip4jConstants.COMP_DEFLATE);
      parameters.setCompressionLevel(Zip4jConstants.DEFLATE_LEVEL_NORMAL);
      zipFile.addFile(refFile, parameters);

      httpHeaders.add("Content-Type", "application/zip");
      httpHeaders.add("Content-Disposition",
        "attachment; filename=\"" + file.getName() + "\"");
      FileInputStream fis = new FileInputStream(file);
View Full Code Here


      else
      {
        // Add each file in the list of references.
        for (Reference reference : references)
        {
          zipFile.addFile(new File(new URI(reference.getDataStoreReference())),
            parameters);
        }
      }

      // Add the product's metadata to the zip file.
View Full Code Here

      // Create zip archives for each product and add them to the dataset zip.
      for (ProductResource productResource : resource.getProductResources())
      {
        File refFile = productZipper.createZipFile(productResource);
        zipFile.addFile(refFile, parameters);
        if (refFile.exists() && !refFile.delete())
        {
          String message = "Unable to delete a temporary product zip ("
            + refFile.getAbsolutePath()
            + ") after adding it to the dataset zip.";
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.