Package org.jets3t.service.multithread

Examples of org.jets3t.service.multithread.DownloadPackage


            String keyPath = (String) s3KeyIter.next();
            S3Object s3Object = (S3Object) s3ObjectsMap.get(keyPath);
           
            if (disrepancyResults.onlyOnServerKeys.contains(keyPath)) {
                printOutputLine("N " + keyPath, false);
                DownloadPackage downloadPackage = ObjectUtils.createPackageForDownload(
                    s3Object, new File(localDirectory, keyPath), isGzipEnabled, isEncryptionEnabled, cryptoPassword);
                if (downloadPackage != null) {
                    downloadPackagesList.add(downloadPackage);
                }
            } else if (disrepancyResults.updatedOnServerKeys.contains(keyPath)) {
                printOutputLine("U " + keyPath, false);
                DownloadPackage downloadPackage = ObjectUtils.createPackageForDownload(
                    s3Object, new File(localDirectory, keyPath), isGzipEnabled, isEncryptionEnabled, cryptoPassword);
                if (downloadPackage != null) {
                    downloadPackagesList.add(downloadPackage);
                }
            } else if (disrepancyResults.alreadySynchronisedKeys.contains(keyPath)) {
                if (isForce) {
                    printOutputLine("F " + keyPath, false);
                    DownloadPackage downloadPackage = ObjectUtils.createPackageForDownload(
                        s3Object, new File(localDirectory, keyPath), isGzipEnabled, isEncryptionEnabled, cryptoPassword);
                    if (downloadPackage != null) {
                        downloadPackagesList.add(downloadPackage);
                    }
                } else {
                    printOutputLine("- " + keyPath, false);
                }
            } else if (disrepancyResults.updatedOnClientKeys.contains(keyPath)) {
                // This file has been updated on the client-side.
                if (isKeepFiles) {
                    printOutputLine("r " + keyPath, false);                   
                } else {
                    printOutputLine("R " + keyPath, false);
                    DownloadPackage downloadPackage = ObjectUtils.createPackageForDownload(
                        s3Object, new File(localDirectory, keyPath), isGzipEnabled, isEncryptionEnabled, cryptoPassword);
                    if (downloadPackage != null) {
                        downloadPackagesList.add(downloadPackage);
                    }
                }
View Full Code Here


                String encryptionPassword = null;
                if (cockpitPreferences.isEncryptionPasswordSet()) {
                    encryptionPassword = cockpitPreferences.getEncryptionPassword();
                }
               
                DownloadPackage downloadPackage = ObjectUtils
                    .createPackageForDownload(objects[i], file, true, true, encryptionPassword);
                   
                if (downloadPackage != null) {
                    downloadObjectsToFileMap.put(objects[i].getKey(), file);
                    downloadPackageList.add(downloadPackage);
View Full Code Here

                    }
                    encryptionUtil = new EncryptionUtil(encryptionPassword, algorithm, version);                                           
                }                   
            }
           
            return new DownloadPackage(object, fileTarget, isZipped, encryptionUtil);
        }
    }
View Full Code Here

        // each object. This class is a simple container which merely associates an object with an
        // output stream, to which the object's data will be written.
       
        // Create a DownloadPackage for each object, to associate the object with an output file.
        DownloadPackage[] downloadPackages = new DownloadPackage[5];
        downloadPackages[0] = new DownloadPackage(objects[0],
            new File(objects[0].getKey()));
        downloadPackages[1] = new DownloadPackage(objects[1],
            new File(objects[1].getKey()));
        downloadPackages[2] = new DownloadPackage(objects[2],
            new File(objects[2].getKey()));
        downloadPackages[3] = new DownloadPackage(objects[3],
            new File(objects[3].getKey()));
        downloadPackages[4] = new DownloadPackage(objects[4],
            new File(objects[4].getKey()));
       
        // Download the objects.
        simpleMulti.downloadObjects(bucket, downloadPackages);
        System.out.println("Downloaded objects to current working directory");
View Full Code Here

                    }
                    encryptionUtil = new EncryptionUtil(encryptionPassword, algorithm, version);                                           
                }                   
            }
           
            return new DownloadPackage(object, fileTarget, isZipped, encryptionUtil);
        }
    }
View Full Code Here

                          for (int i = 0; i < signedRequests.length; i++) {
                            S3Object object = signedRequests[i].buildObject();
                           
                              File file = new File(downloadDirectory, object.getKey());
   
                DownloadPackage downloadPackage = ObjectUtils.createPackageForDownload(
                    object, file, true, false, null);
                if (downloadPackage == null) {
                  continue;
                }
                downloadPackage.setSignedUrl(signedRequests[i].getSignedUrl());
 
                              downloadObjectsToFileMap.put(object.getKey(), file);
                              downloadPackageList.add(downloadPackage);
                          }
                          DownloadPackage[] downloadPackagesArray = (DownloadPackage[])
View Full Code Here

                                // Create local directories corresponding to objects flagged as dirs.
                                if (Mimetypes.MIMETYPE_JETS3T_DIRECTORY.equals(object.getContentType())) {
                                    file.mkdirs();                   
                                }                           

                DownloadPackage downloadPackage = ObjectUtils.createPackageForDownload(
                    object, file, true, false, null);
                if (downloadPackage == null) {
                  continue;
                }
                downloadPackage.setSignedUrl(signedRequests[i].getSignedUrl());
 
                              downloadObjectsToFileMap.put(object.getKey(), file);
                              downloadPackageList.add(downloadPackage);
                          }
                          DownloadPackage[] downloadPackagesArray = (DownloadPackage[])
View Full Code Here

            // Create local directories corresponding to objects flagged as dirs.
            if (Mimetypes.MIMETYPE_JETS3T_DIRECTORY.equals(objects[i].getContentType())) {
                file.mkdirs();                   
            }                           
           
            DownloadPackage downloadPackage = ObjectUtils
                .createPackageForDownload(objects[i], file, true, true, encryptionPassword);
               
            if (downloadPackage != null) {
                downloadObjectsToFileMap.put(objects[i].getKey(), file);
                downloadPackageList.add(downloadPackage);
View Full Code Here

            // Create local directories corresponding to objects flagged as dirs.
            if (Mimetypes.MIMETYPE_JETS3T_DIRECTORY.equals(objects[i].getContentType())) {
                file.mkdirs();                   
            }                           
           
            DownloadPackage downloadPackage = ObjectUtils
                .createPackageForDownload(objects[i], file, true, true, encryptionPassword);
               
            if (downloadPackage != null) {
                downloadObjectsToFileMap.put(objects[i].getKey(), file);
                downloadPackageList.add(downloadPackage);
View Full Code Here

        // each object. This class is a simple container which merely associates an object with a 
        // file, to which the object's data will be written.
       
        // Create a DownloadPackage for each object, to associate the object with an output file.
        DownloadPackage[] downloadPackages = new DownloadPackage[5];
        downloadPackages[0] = new DownloadPackage(objects[0],
            new File(objects[0].getKey()));
        downloadPackages[1] = new DownloadPackage(objects[1],
            new File(objects[1].getKey()));
        downloadPackages[2] = new DownloadPackage(objects[2],
            new File(objects[2].getKey()));
        downloadPackages[3] = new DownloadPackage(objects[3],
            new File(objects[3].getKey()));
        downloadPackages[4] = new DownloadPackage(objects[4],
            new File(objects[4].getKey()));
       
        // Download the objects.
        simpleMulti.downloadObjects(bucket, downloadPackages);
        System.out.println("Downloaded objects to current working directory");
View Full Code Here

TOP

Related Classes of org.jets3t.service.multithread.DownloadPackage

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.