Package org.jets3t.service.multithread

Examples of org.jets3t.service.multithread.DownloadPackage


        // 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


                    }
                }          
                               
                if (discrepancyResults.onlyOnServerKeys.contains(keyPath)) {
                    printOutputLine("N " + keyPath, REPORT_LEVEL_ACTIONS);
                    DownloadPackage downloadPackage = ObjectUtils.createPackageForDownload(
                        s3Object, fileTarget, isGzipEnabled, isEncryptionEnabled, cryptoPassword);
                    if (downloadPackage != null) {
                        downloadPackagesList.add(downloadPackage);
                    }
                } else if (discrepancyResults.updatedOnServerKeys.contains(keyPath)) {
                    printOutputLine("U " + keyPath, REPORT_LEVEL_ACTIONS);
                    DownloadPackage downloadPackage = ObjectUtils.createPackageForDownload(
                        s3Object, fileTarget, isGzipEnabled, isEncryptionEnabled, cryptoPassword);
                    if (downloadPackage != null) {
                        downloadPackagesList.add(downloadPackage);
                    }
                } else if (discrepancyResults.alreadySynchronisedKeys.contains(keyPath)) {
                    if (isForce) {
                        printOutputLine("F " + keyPath, REPORT_LEVEL_ACTIONS);
                        DownloadPackage downloadPackage = ObjectUtils.createPackageForDownload(
                            s3Object, fileTarget, isGzipEnabled, isEncryptionEnabled, cryptoPassword);
                        if (downloadPackage != null) {
                            downloadPackagesList.add(downloadPackage);
                        }
                    } else {
                        printOutputLine("- " + keyPath, REPORT_LEVEL_ALL);
                    }
                } else if (discrepancyResults.updatedOnClientKeys.contains(keyPath)) {
                    // This file has been updated on the client-side.
                    if (isKeepFiles) {
                        printOutputLine("r " + keyPath, REPORT_LEVEL_DIFFERENCES);                   
                    } else {
                        printOutputLine("R " + keyPath, REPORT_LEVEL_ACTIONS);
                        DownloadPackage downloadPackage = ObjectUtils.createPackageForDownload(
                            s3Object, fileTarget, isGzipEnabled, isEncryptionEnabled, cryptoPassword);
                        if (downloadPackage != null) {
                            downloadPackagesList.add(downloadPackage);
                        }
                    }
View Full Code Here

                    }
                    encryptionUtil = new EncryptionUtil(encryptionPassword, algorithm, version);                                           
                }                   
            }
           
            return new DownloadPackage(object, fileTarget, isZipped, encryptionUtil);
        }
    }
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

                    }
                }          
                               
                if (discrepancyResults.onlyOnServerKeys.contains(keyPath)) {
                    printOutputLine("N " + keyPath, REPORT_LEVEL_ACTIONS);
                    DownloadPackage downloadPackage = ObjectUtils.createPackageForDownload(
                        s3Object, fileTarget, isGzipEnabled, isEncryptionEnabled, cryptoPassword);
                    if (downloadPackage != null) {
                        downloadPackagesList.add(downloadPackage);
                    }
                } else if (discrepancyResults.updatedOnServerKeys.contains(keyPath)) {
                    printOutputLine("U " + keyPath, REPORT_LEVEL_ACTIONS);
                    DownloadPackage downloadPackage = ObjectUtils.createPackageForDownload(
                        s3Object, fileTarget, isGzipEnabled, isEncryptionEnabled, cryptoPassword);
                    if (downloadPackage != null) {
                        downloadPackagesList.add(downloadPackage);
                    }
                } else if (discrepancyResults.alreadySynchronisedKeys.contains(keyPath)) {
                    if (isForce) {
                        printOutputLine("F " + keyPath, REPORT_LEVEL_ACTIONS);
                        DownloadPackage downloadPackage = ObjectUtils.createPackageForDownload(
                            s3Object, fileTarget, isGzipEnabled, isEncryptionEnabled, cryptoPassword);
                        if (downloadPackage != null) {
                            downloadPackagesList.add(downloadPackage);
                        }
                    } else {
                        printOutputLine("- " + keyPath, REPORT_LEVEL_ALL);
                    }
                } else if (discrepancyResults.updatedOnClientKeys.contains(keyPath)) {
                    // This file has been updated on the client-side.
                    if (isKeepFiles) {
                        printOutputLine("r " + keyPath, REPORT_LEVEL_DIFFERENCES);                   
                    } else {
                        printOutputLine("R " + keyPath, REPORT_LEVEL_ACTIONS);
                        DownloadPackage downloadPackage = ObjectUtils.createPackageForDownload(
                            s3Object, fileTarget, isGzipEnabled, isEncryptionEnabled, cryptoPassword);
                        if (downloadPackage != null) {
                            downloadPackagesList.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

                    ObjectUtils.convertDirPlaceholderKeyNameToDirName(
                        objects[i].getKey()));
                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

                                        ObjectUtils.convertDirPlaceholderKeyNameToDirName(
                                            objects[i].getKey()));
                                    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

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.