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

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


        try {
            _logger.log(Level.FINE,
                 "synchronization.process_command", _request.getMetaFileName());

            String baseDir   = _request.getBaseDirectory();
            Unzipper z       = new Unzipper(baseDir);
            byte[] zipBytes  = _response.getZipBytes();
            long checksum    = 0;

            // if byte exists in response
            if (zipBytes != null) {

                // render the zip bytes
                checksum = z.writeZipBytes(zipBytes);

            } else { // handle a re-direct
                File tempZip = null;

                // DAS and server instance are running on the same machine
                // skips download and uses the zip directly
                if (isSameHost()) {
                    String dasZipLoc  = _response.getZipLocation();
                    tempZip           = new File(dasZipLoc);
                } else {
                    // download the zip file
                    tempZip = downloadZip();
                }

                // render the zip file
                if (tempZip != null && tempZip.exists()) {

                    // ignore response entry for http based impl
                    z.ignoreEntry(ServletProcessor.RESPONSE_ENTRY_NAME);

                    checksum = z.writeZipFile(tempZip.getCanonicalPath());
                }
            }

            //assert(_response.getChecksum() == checksum);
View Full Code Here


            }

            // target name will be part of root dir
            if (rootDir.indexOf(target) > 0) {

                Unzipper z = new Unzipper(rootDir);
                z.writeZipFile(zip);

                // successful msg
                CLILogger.getInstance().printDetailMessage(
                    _strMgr.getString("ApplyRepositoryZipCommandSuccessful",
                    new Object[] {name, zip}));
View Full Code Here

            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);                                             
            assertTrue(!new File(resultDirectory).exists());
        } catch (Exception ex) {
            ex.printStackTrace();
            fail(ex.toString());
        }       
View Full Code Here

            //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
            assertTrue(Utils.areIdentical(".", resultDirectory));           
        } catch (Exception ex) {
            ex.printStackTrace();
            fail(ex.toString());
View Full Code Here

            //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           
            assertTrue(Utils.areIdentical(".", resultDirectory));
        } catch (Exception ex) {
            ex.printStackTrace();
            fail(ex.toString());
View Full Code Here

            ObjectName objname = new ObjectName(server.getDefaultDomain() + ":type=" + "Synchronization");   
            SynchronizationResponse result =
                (SynchronizationResponse)server.invoke(
                    objname, "synchronize", new Object[]{ requests },
                    new String[]{ "[Lcom.sun.enterprise.ee.synchronization.SynchronizationRequest;" });
            Unzipper uz = new Unzipper(localdir);
            uz.writeZipBytes(result.getZipBytes());
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }
View Full Code Here

                fileName, ".", 0L,
                SynchronizationRequest.TIMESTAMP_MODIFICATION_TIME, null);           
            SynchronizationResponse result = (SynchronizationResponse)_serverConnection.invoke(
                    _server.getSynchronizationMBeanName(), "synchronize", new Object[]{ requests },
                    new String[]{ "[Lcom.sun.enterprise.ee.synchronization.SynchronizationRequest;" });
            Unzipper z = new Unzipper(resultDirectory);
            long checksum = z.writeZipBytes(result.getZipBytes());
            //Check to make sure that the two match
            assertEquals(result.getChecksum(), checksum);
            assertTrue(Utils.areIdentical(fileName,
                resultDirectory + File.separator + fileName));   
        } catch (Exception ex) {
View Full Code Here

                SynchronizationRequest.TIMESTAMP_MODIFICATION_TIME, null);
            SynchronizationResponse result =
                (SynchronizationResponse)_serverConnection.invoke(
                    _server.getSynchronizationMBeanName(), "synchronize", new Object[]{ requests },
                    new String[]{ "[Lcom.sun.enterprise.ee.synchronization.SynchronizationRequest;" });
            Unzipper z = new Unzipper(resultDirectory);
            long checksum = z.writeZipBytes(result.getZipBytes());
            //Check to make sure that the two match
            assertEquals(result.getChecksum(), checksum);
            assertTrue(Utils.areIdentical(files[0],
                resultDirectory + File.separator + files[0]));   
            assertTrue(Utils.areIdentical(files[1],
View Full Code Here

TOP

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

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.