Examples of ZipFile


Examples of br.com.jteam.jfcm.model.ZipFile

  @Override
  public File createFile(
      String name,
      String path)
  {
    return new ZipFile(
        name,
        path);
  }
View Full Code Here

Examples of com.alimama.mdrill.utils.zip.ZipFile

     */
    public static void unZip(FileSystem fs,String zipFilePath, FileSystem fs2,String destDir) throws Exception {
      FSDataInputStream in=fs.open(new Path(zipFilePath));
      long length = fs.getFileStatus(new Path(zipFilePath)).getLen();

        ZipFile zipFile = new ZipFile(in,length, CHINESE_CHARSET,true);
        Enumeration<?> emu = zipFile.getEntries();
        BufferedInputStream bis;
        FSDataOutputStream fos;
        BufferedOutputStream bos;
        Path file, parentFile;
        ZipEntry entry;
        byte[] cache = new byte[CACHE_SIZE];
        while (emu.hasMoreElements()) {
            entry = (ZipEntry) emu.nextElement();
            if (entry.isDirectory()) {
              fs2.mkdirs(new Path(destDir , entry.getName()));
                continue;
            }
            bis = new BufferedInputStream(zipFile.getInputStream(entry));
            file = new Path(destDir , entry.getName());
            parentFile = file.getParent();
            if (parentFile != null && (!fs2.exists(parentFile))) {
              fs2.mkdirs(parentFile);
            }
            fos =fs2.create(file,true);
            bos = new BufferedOutputStream(fos, CACHE_SIZE);
            int nRead = 0;
            while ((nRead = bis.read(cache, 0, CACHE_SIZE)) != -1) {
                fos.write(cache, 0, nRead);
            }
            bos.flush();
            bos.close();
            fos.close();
            bis.close();
        }
        zipFile.close();
    }
View Full Code Here

Examples of com.jverrecchia.initializr.builder.files.ZipFile

    //Files files = new Files(modules.getModules());

    List<ZipFile> zipFiles = new ArrayList<ZipFile>();   
   
    for (File currentFile : mode.getFiles()){
      ZipFile currentZipFile = new ZipFile();
      currentZipFile.setZipPath(currentFile.getRealPath());
      if (currentFile.isModify()){
        currentZipFile.setTemplate(new TemplateFile(currentFile.getTemplatePath()));
        currentZipFile.fillContent(mode);
      }
      else
        currentZipFile.copyContent(currentFile);
      zipFiles.add(currentZipFile);
    }

   
    //ZipFile zipfile1 = new ZipFile();
View Full Code Here

Examples of com.sun.enterprise.util.zip.ZipFile

        FileUtils.copy(
               layout.getHttpBcArchiveSource(),
               layout.getHttpBcArchiveDestination());
        ZipFile zf = new ZipFile(layout.getHttpBcArchiveSource(), layout.getHttpBcInstallRoot());
        ArrayList list = zf.explode();
    }
View Full Code Here

Examples of de.schlichtherle.truezip.zip.ZipFile

    public TrueZipZipFileHandle( final File targetFile )
        throws IOException
    {
        super( targetFile );

        this.zipFile = new ZipFile( targetFile );
    }
View Full Code Here

Examples of de.schlichtherle.util.zip.ZipFile

     */
    public TrueZipMcRegionChunkStore(File zipFile, String folder) throws IOException, ZipException {
        this.zipFile = zipFile;
        this.folder = folder;

        zip = new ZipFile(zipFile);
    }
View Full Code Here

Examples of flex2.compiler.swc.zip.ZipFile

     * Fills in "files" with an InMemoryFile for each zip file entry.
     */
    public void load()
    {
        files = new HashMap<String, VirtualFile>();
      ZipFile zipFile = null;

        try
        {
          zipFile = new ZipFile(path);
          Enumeration e = zipFile.getEntries();
          while (e.hasMoreElements())
          {
            ZipEntry ze = (ZipEntry)e.nextElement();
                InputStream inputStream = zipFile.getInputStream(ze);
                VirtualFile f = new InMemoryFile( inputStream, ze.getSize(), path + "$" + ze.getName(),
                    MimeMappings.getMimeType(ze.getName()), ze.getTime() );
                files.put( ze.getName(), f );
            }
        }
        catch (SwcException.UnknownZipFormat e)
        {
          throw new SwcException.NotASwcFile(path);
        }
        catch (SwcException e)
        {
          throw e;
        }
        catch (Exception e)
        {
            throw new SwcException.FilesNotRead( e.getMessage() );
        }
        finally
        {
            try
            {
                if (zipFile != null)
                    zipFile.close();
            }
            catch(IOException ioe)
            {
                // ignore
            }
View Full Code Here

Examples of gnu.zip.ZipFile

    public ArchiveZip(final String filename)
            throws IOException {

        this.file = new RandomReadingFile(filename);
        this.zip = new ZipFile(file);
    }
View Full Code Here

Examples of java.util.zip.ZipFile

   *            The root directory to extract to.
   * @throws IOException
   */
  static void extract(final File sourceZipFile, File unzipDestinationDirectory) throws IOException {
    // Open Zip file for reading
    ZipFile zipFile = new ZipFile(sourceZipFile, ZipFile.OPEN_READ);

    // Create an enumeration of the entries in the zip file
    Enumeration zipFileEntries = zipFile.entries();

    // Process each entry
    while (zipFileEntries.hasMoreElements()) {
      // grab a zip file entry
      ZipEntry entry = (ZipEntry) zipFileEntries.nextElement();

      String currentEntry = entry.getName();

      File destFile = new File(unzipDestinationDirectory, currentEntry);

      // grab file's parent directory structure
      File destinationParent = destFile.getParentFile();

      // create the parent directory structure if needed
      destinationParent.mkdirs();

      // extract file if not a directory
      if (!entry.isDirectory()) {
        ObjectConverterUtil.write(zipFile.getInputStream(entry),
            destFile);
      }
    }
    zipFile.close();
  }
View Full Code Here

Examples of java.util.zip.ZipFile

        log.info("retrieve " + f);
       
        // create document and read it from file
        doc = new HttpDoc();
        doc.setURL(url);
        ZipFile zf = new ZipFile(f);
       
        // read headers
        readHeadersFromZipFile(doc, zf);
       
        // read links
        readLinksFromZipFile(doc, zf);
       
        doc.setCached(true);
       
        // read content
        String md5 = doc.getContentMD5();
        File contentFile = contentFile(md5, ".zip");
        if (contentFile.exists()) {
          ZipFile contentZip = new ZipFile(contentFile);
          readContentFromZipFile(doc, contentZip);
          contentZip.close();
        } else {
          doc.setContent(new byte[0]);
        }
        zf.close();
      }
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.