Examples of Zipper


Examples of com.sun.enterprise.ee.util.zip.Zipper

            long startTime  = System.currentTimeMillis() + _ctx.getTimeDelta();
            _ctx.setStartTime(startTime);
            long zipSize = 0;

            for (int i = 0; i < request.length; i++) {
                Zipper z = new Zipper(null, 0L);

                // init zipper
                initZipper(request[i], z);

                // generate inventory for this request
                if (_ctx.isProcessInventory()) {
                    processInventory(request[i]);
                }

                if (isModified(request[i]) || z.hasAlwaysInclude()) {
                    _logger.log(Level.FINE, "synchronization.req_mod_file_info",
                        request[i].getFileName());

                    // set exclude list for unassociated applications
                    if (request[i].isExclude()) {
                        setExcludeList(request[i], z);
                    }

                    // add the exclude regular expression for this request
                    List ePattern = request[i].getExcludePatternList();
                    z.addToExcludePatternList(ePattern);

                    // sets the shallow copy flag
                    z.setShallowCopyEnabled(request[i].isShallowCopyEnabled());

                    // add the include regular expression for this request
                    // include patterns has precidence over exclude patterns
                    List iPattern = request[i].getIncludePatternList();
                    z.addToIncludePatternList(iPattern);

                    if (request[i].getTimestampType()
                        == SynchronizationRequest.TIMESTAMP_MODIFIED_SINCE) {
                        z.setLastModifiedTime(request[i].getTimestamp());
                    } else {
                        z.setLastModifiedTime(0L);
                    }

                    // add the file or directory to zipper
                    file = request[i].getFile();
                    addFileToZip(file, z, request[i]);

                    results[i] = request[i];
                    zipSize += z.getZipSize();
                } else {
                    _logger.log(Level.FINE,
                        "synchronization.req_not_mod_file_info",
                        request[i].getFileName());
View Full Code Here

Examples of com.sun.enterprise.ee.util.zip.Zipper

        requests[0].setGCEnabled(true);

        InventoryMgr mgr = new InventoryMgr(new File("."));
        requests[0].setInventory(mgr.getInventory());

        Zipper z = new Zipper(null, 0L);
        z.setBaseDirectory(".");
        byte[] b = z.createZipBytesFromDirectory(".");

        // synchronization response
        SynchronizationResponse res =
            new SynchronizationResponse(b, requests, 0, 0, 0);
View Full Code Here

Examples of com.sun.enterprise.ee.util.zip.Zipper

    public void testEmptyZip() {       
        try {
            String resultDirectory = Utils.getTemporaryDirectory("testEmptyZip");
           
            //Zip up the current directory and write it the testZipFile.zip
            Zipper z = new Zipper(".");       
            byte[] bytes = z.createZipBytesFromDirectory("jxmp463retuyytyl");
            //Unzip the newly created directory and write it to the
            //testZipper subdirectory
            assertEquals(bytes.length, 0);           
            Unzipper uz = new Unzipper(resultDirectory);
            uz.writeZipBytes(bytes);                                             
View Full Code Here

Examples of com.sun.enterprise.ee.util.zip.Zipper

   
    public void testZipBytes() {        
        try {
            String resultDirectory = Utils.getTemporaryDirectory("testZipBytes");
            //Zip up the current directory and write it the testZipFile.zip
            Zipper z = new Zipper(".");       
            byte[] bytes = z.createZipBytesFromDirectory(".");           
            //Unzip the newly created directory and write it to the
            //testZipper subdirectory
            Unzipper uz = new Unzipper(resultDirectory);
            uz.writeZipBytes(bytes);          
            //Check to make sure that the two match
View Full Code Here

Examples of com.sun.enterprise.ee.util.zip.Zipper

            String zipName = System.getProperty("java.io.tmpdir") +
                File.separator + "testZipFile.zip";
            File f = new File(zipName);
            String resultDirectory = Utils.getTemporaryDirectory("testZipFile");
            //Zip up the current directory and write it the testZipFile.zip
            Zipper z = new Zipper(".");       
            z.createZipFileFromDirectory(".", zipName);           
            //Unzip the newly created directory and write it to the
            //testZipper subdirectory
            Unzipper uz = new Unzipper(resultDirectory);
            uz.writeZipFile(zipName);             
            //Check to make sure that the two match           
View Full Code Here

Examples of com.yahoo.omid.replication.Zipper

   }

   @Override
   synchronized
   public void channelOpen(ChannelHandlerContext ctx, ChannelStateEvent e) {
      e.getChannel().getPipeline().addFirst("decoder", new TSODecoder(new Zipper()));
      e.getChannel().getPipeline().addAfter("decoder", "encoder",
                                            new TSOEncoder());
   }
View Full Code Here

Examples of com.yahoo.omid.replication.Zipper

        withConnection(new AbortCompleteOp(transactionId, cb));
    }

    @Override
    synchronized public void channelOpen(ChannelHandlerContext ctx, ChannelStateEvent e) {
        e.getChannel().getPipeline().addFirst("decoder", new TSODecoder(new Zipper()));
        e.getChannel().getPipeline().addAfter("decoder", "encoder", new TSOEncoder());
    }
View Full Code Here

Examples of no.kommune.bergen.soa.common.zip.Zipper

      client.getHostConfiguration().setProxy( httpProxyHost, Integer.parseInt( httpProxyPort.trim() ) );
    }
  }

  void zipItUp( InputStream inputstream, String filename, OutputStream outputStream ) {
    Zipper zipper = new Zipper( outputStream );
    try {
      zipper.addEntry( filename, inputstream );
      zipper.close();
    } catch (IOException e1) {
      throw new RuntimeException( "Failed to zip up " + filename, e1 );
    }
  }
View Full Code Here

Examples of org.sf.bee.commons.zip.Zipper

    @Override
    public InputStream getContent()
            throws IOException, IllegalStateException {
        // the wrapped entity's getContent() decides about repeatability
        final InputStream wrappedin = super.wrappedEntity.getContent();
        final Zipper zip = new Zipper();
        return zip.gunzip(wrappedin);
    }
View Full Code Here

Examples of org.sf.bee.commons.zip.Zipper

    @Override
    public InputStream getContent()
            throws IOException, IllegalStateException {
        final InputStream in = super.wrappedEntity.getContent();
        final Zipper zip = new Zipper();
        return zip.gzip(in);
    }
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.