Package org.jitterbit.integration.client.project.jitterpack

Examples of org.jitterbit.integration.client.project.jitterpack.JitterPackDescriptor


    private void unpackImpl(JitterPack jitterpack, ImportParameters params, File destinationFolder,
                    UnpackCallback callback) {
        logUnpackRequest(jitterpack, destinationFolder);
        try {
            DescriptorExtractor extractor = new DescriptorExtractor(jitterpack.getFile(), params, null);
            JitterPackDescriptor descriptor = extractor.extract();
            DestinationChecker destinationChecker = new DestinationChecker();
            if (!destinationChecker.isLocationOk(params, descriptor, destinationFolder)) {
                logDestinationDenied(destinationFolder);
                callback.unpackingCancelled(null);
                return;
View Full Code Here


    protected Object[] getColumnDataForTypedObject(JitterPack jp) {
        return small ? createSmallRow(jp) : createLargeRow(jp);
    }

    private Object[] createSmallRow(JitterPack jp) {
        JitterPackDescriptor descriptor = jp.getDescriptor();
        return new Object[] { new JitterPackLocationTableItem(jp.getFile()), descriptor.getProjectName(),
                        descriptor.createdAt(), descriptor.getVersionInfo().minimumRequired(),
                        Boolean.valueOf(descriptor.isEncrypted()),
                        Boolean.valueOf(descriptor.isPackedProjectReadOnly()), };
    }
View Full Code Here

                        Boolean.valueOf(descriptor.isEncrypted()),
                        Boolean.valueOf(descriptor.isPackedProjectReadOnly()), };
    }

    private Object[] createLargeRow(JitterPack jp) {
        JitterPackDescriptor descriptor = jp.getDescriptor();
        return new Object[] { new JitterPackLocationTableItem(jp.getFile()), descriptor.getProjectName(),
                        descriptor.createdAt(), descriptor.getVersionInfo().minimumRequired(),
                        Boolean.valueOf(descriptor.isEncrypted()),
                        Boolean.valueOf(descriptor.isPackedProjectReadOnly()), };
    }
View Full Code Here

    }

    public IntegrationProject unpack(JitterPack jp) {
        try {
          consoleWriter.log("Unpacking the Jitterpak " + jp.getFile());
            JitterPackDescriptor descriptor = jp.getDescriptor();
            ImportParameters params = ImportParameters.DEFAULT;
            Importer importer = createImporter(params);
            IntegrationProject p = importer.unpack(jp, descriptor, destination, params, new IssuesLogger(this.consoleWriter));
            projectManager.setCurrentProject(p);
            return p;
View Full Code Here

    }

    static JitterPack createFromFile(File file, Version version, ImportParameters params) throws IOException,
                    IllegalDataFormatException, UnsupportedVersionException {
        JitterPackFormat format = JitterPackFormatFactory.getFormat(version, params);
        JitterPackDescriptor descriptor = format.extractDescriptor(file);
        return new JitterPack(file, descriptor);
    }
View Full Code Here

        return new JitterPack(file, descriptor);
    }

    static VersionInfo isPossibleJitterPack(File file, ImportParameters params) {
        try {
            JitterPackDescriptor d = new DefaultJitterPackHeader(params).extractFromPackedData(file);
            return d.getVersionInfo();
        } catch (IllegalDataFormatException ex) {
            // The file is not a JitterPack.
        } catch (IOException e) {
            // The file is not a JitterPack.
        } catch (InvalidPasswordException e) {
View Full Code Here

                                        throws IllegalDataFormatException,
                                                UnpackException,
                                                UnsupportedVersionException {
        logUnpackRequest(jitterPack, destination);
        try {
            JitterPackDescriptor descriptor = extractDescriptor(jitterPack);
            checkVersion(descriptor);
            String projectFolderName = descriptor.getFolderName();
            File projectFolder = clearDestinationFolder(destination, projectFolderName);
            createAndUnzipProjectFolder(jitterPack, destination);
            String projectName = descriptor.getProjectName();
            String comment = descriptor.getComment();
            return new ProjectDescriptor(projectName, projectFolder, comment);
        } catch (KongaZipException ex) {
            UnpackException ex2 = new UnpackException("An error occurred when unpacking the "
                    + JitterPackConstants.SINGULAR + ": " + ex.getMessage(), ex);
            logUnpackException(ex2);
View Full Code Here

    @Override
    public JitterPack pack(ManagedProject project, String comment, File target) throws JitterPackException {
        try {
            File projectFolder = project.getLocation();
            JitterPackDescriptor descriptor = createDescriptorForWriting(project, comment);
            header.write(descriptor, projectFolder);
            zipProject(projectFolder, target);
            return new JitterPack(target, descriptor);
        } catch (KongaZipException ex) {
            throw new JitterPackException("An error occurred: " + ex.getMessage(), ex);
View Full Code Here

TOP

Related Classes of org.jitterbit.integration.client.project.jitterpack.JitterPackDescriptor

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.