Package com.salesforce.ide.core.internal.utils.ZipUtils

Examples of com.salesforce.ide.core.internal.utils.ZipUtils.ZipStats


        // streams to contain components
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        ZipOutputStream zos = new ZipOutputStream(bos);

        // new zip stats to gather info about zip
        ZipStats stats = new ZipStats();
        for (ProjectPackage projectPackage : this) {
            projectPackage.addComponentsToZip(stats, zos, manifestsOnly);
        }

        // close zip stream and get bytes
        zos.close();
        zipAsBytes = bos.toByteArray();

        if (logger.isDebugEnabled()) {
            logger.debug("Zip stats for entire project package list:\n" + stats.toString());
            ZipUtils.writeDeployZipToTempDir(zipAsBytes);
        }

        return zipAsBytes;
    }
View Full Code Here


        // streams to contain components
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        ZipOutputStream zos = new ZipOutputStream(bos);

        // new zip stats to gather info about zip
        ZipStats stats = new ZipStats();

        // add each component in component list to zip
        for (Component component : componentList) {
            if (manifestsOnly && !component.isPackageManifest()) {
                continue;
            }

            IFile file = component.getFileResource();
            IPath path = file.getFullPath();
            stats.addStats(ZipUtils.zipFile(file.getProjectRelativePath().toPortableString(), path.toFile(), zos,
                Integer.MAX_VALUE));
        }

        // close zip stream and get bytes
        zos.close();
        zipAsBytes = bos.toByteArray();

        if (logger.isDebugEnabled()) {
            logger.debug(stats.toString());
        }
        return zipAsBytes;
    }
View Full Code Here

        for (Component component : componentList) {
            if (manifestsOnly && !component.isPackageManifest()) {
                continue;
            }

            ZipStats tmpStats = null;
            String filePath = Utils.stripSourceFolder(component.getMetadataFilePath());
            // retrieve component content from file first instead of component body, see bug
            // W-576656
            if (component.getFileResource() != null) {
                File file = component.getFileResource().getRawLocation().toFile();
View Full Code Here

            logger.warn("Delete manifest string is null - not including in zip");
            return;
        }

        // get zip and add to zip stats
        ZipStats tmpStats =
                ZipUtils.zipFile(Constants.DESTRUCTIVE_MANIFEST_FILE_NAME, deleteManifestStr, zos, Integer.MAX_VALUE);

        if (logger.isDebugEnabled()) {
            logger.debug("Added  '" + Constants.DESTRUCTIVE_MANIFEST_FILE_NAME + "' to zip with zip stats:\n "
                    + tmpStats.toString());
        }

        if (stats != null) {
            stats.addStats(tmpStats);
        }
View Full Code Here

                logger.info("Deleted zip '" + zipPath + File.separator + zipName + ".zip" + "'");
            }
        }

        ZipOutputStream zipFileStream = new ZipOutputStream(new FileOutputStream(zipFile));
        ZipStats stats = new ZipStats();

        if (Utils.isEmpty(componentList)) {
            return;
        }

        for (Component component: componentList) {
            if (component.getFileResource() == null && Utils.isEmpty(component.getBody())) {
                logger.warn("File and body for component " + component.getFullDisplayName() + " is null");
                continue;
            }

            ZipStats tmpStats = null;
            String filePath = Utils.stripSourceFolder(component.getMetadataFilePath());
            if (component.getFileResource() != null) {
                File file = component.getFileResource().getRawLocation().toFile();
                if (!file.exists()) {
                    logger.warn("File '" + file.getAbsolutePath() + "' does not exist");
View Full Code Here

TOP

Related Classes of com.salesforce.ide.core.internal.utils.ZipUtils.ZipStats

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.