Package org.jitterbit.application.filestore

Examples of org.jitterbit.application.filestore.FileStoreFile


    private void addRequiredFile(String path, int iType) throws DeployException {
        if (hasFileBeenAdded(path))
            return;

        try {
            FileStoreFile file = m_fileStore.getFile(path);
            if (file == null) {
                throw new DeployException("Failed to get the file \"" + path
                                + "\" from the file store. This is probably a bug.");
            }

            CRequiredFile requiredFile = new CRequiredFile();

            requiredFile.setMD5(file.getMD5());
            requiredFile.setModifiedTime(file.getPhysicalRepresentation().lastModified());

            requiredFile.setPath(path);
            requiredFile.setType(iType);

            // This is not set here, only when we need to send it,
View Full Code Here


                        // on the client we will probably come here once in a while.
                        continue;
                    }

                    try {
                        FileStoreFile file = m_fileStore.getFile(path);
                        File physicalFile = file.getPhysicalRepresentation();
                        String zippedBase64EncodedContents = ZipUtils.deflateAndBase64EncodeFileContents(physicalFile
                                        .getAbsolutePath());
                        requiredFile.setZippedBase64Contents(zippedBase64EncodedContents);
                        requiredFile.setModifiedTime(physicalFile.lastModified());
                    } catch (IOException e) {
View Full Code Here

        }
    }

    private void addAllFiles(Set<FileUi> files) {
        for (Iterator<FileStoreFile> it = root.getChildren(); it.hasNext();) {
            FileStoreFile f = it.next();
            if (LatestFile.isPropertyFile(f.getPhysicalRepresentation())) {
                continue;
            }
            FileUi ui = getFileUi(f);
            if (!files.contains(ui)) {
                files.add(ui);
View Full Code Here

     * Checks if the file used in the Load Source comes from the project file store.
     * If it does we do not need to add it again.
     */
    private boolean isFileFromFileStore(File file, String fileStorePath) {
        FileStore files = delegate.getFiles();
        FileStoreFile existingFile = files.getFile(fileStorePath);
        return existingFile != null && existingFile.getPhysicalRepresentation().getAbsolutePath().equals(file.getAbsolutePath());
    }
View Full Code Here

                    }
                    List<File> files = Lists.newArrayList();
                    for (String path : required) {
                        // Since this file has already been uploaded once, path holds
                        // the path to the file in the client filestore:
                        FileStoreFile file = client.getFileStore().getFile(path);
                        if (file == null) {
                            // TODO: How to handle this?
                            String msg = "An internal error occurred. Please contact Jitterbit support.\n\n"
                                            + "The path '" + path
                                            + "' was not found in the client filestore, even though it "
                                            + "was just uploaded to the server.";
                            Exception ex = new Exception(msg);
                            caught(ex);
                        } else {
                            files.add(file.getPhysicalRepresentation());
                        }
                    }
                    if (isDone()) {
                        break;
                    } else {
View Full Code Here

        return isFileUpToDate(d.getPath(), d.getMD5());
    }
   
    private boolean isFileUpToDate(String path, String md5) {
        try {
            FileStoreFile inStore = client.getFileStore().getFile(path);
            if (inStore != null) {
                return md5.equals(inStore.getMD5());
            }
        } catch (Exception ex) {
            ErrorLog.log(FileDownloadManager.class,
                            "An error occurred while checking the client file store for the selected server file", ex);
        }
View Full Code Here

        this.oldWsInfo = loadOldWsInfo(fileStore, oldWsdlFile);
    }

    private WebServiceInfo loadOldWsInfo(FileStore fileStore, WsdlFile oldWsdlFile) {
        try {
            FileStoreFile file = fileStore.getFile(oldWsdlFile.getLocator());
            if (file != null) {
                return new WebServiceInfoBuilder().build(file.getPhysicalRepresentation());
            }
        } catch (Exception ex) {
            ex.printStackTrace();
        }
        return null;
View Full Code Here

            }
        }

        private Collection<File> getRequiredFiles() throws FileStoreException {
            Set<File> required = new HashSet<File>();
            FileStoreFile file = fileStore.getFile(wsdl.getLocator());
            if (file != null) {
                collectDependencies(fileStore, file, required);
            }
            return required;
        }
View Full Code Here

TOP

Related Classes of org.jitterbit.application.filestore.FileStoreFile

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.