Package com.sun.enterprise.ee.util.zip

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


        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

    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

   
    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

            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

TOP

Related Classes of com.sun.enterprise.ee.util.zip.Zipper

Copyright © 2018 www.massapicom. 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.