/** * A convenience method to download multiple objects to pre-existing * output streams, which is particularly useful for downloading objects to files. * <p> * The maximum number of threads is controlled by the JetS3t configuration property * <tt>threaded-service.max-thread-count</tt>. * <p> * If the JetS3t configuration property <tt>downloads.restoreLastModifiedDate</tt> is set * to true, any files created by this method will have their last modified date set according * to the value of the object's {@link Constants#METADATA_JETS3T_LOCAL_FILE_DATE} metadata * item. * * @param bucketName * name of the bucket containing the objects * @param downloadPackages * an array of download packages containing the object to be downloaded, and able to build * an output stream where the object's contents will be written to. * * @return * true if all the threaded tasks completed successfully, false otherwise. * @throws ServiceException */ public boolean downloadObjects(final String bucketName, final DownloadPackage[] downloadPackages) throws ServiceException { return downloadObjects(bucketName, downloadPackages, null); }
/** * A convenience method to download multiple objects to pre-existing * output streams, which is particularly useful for downloading objects to files. * <p> * The maximum number of threads is controlled by the JetS3t configuration property * <tt>threaded-service.max-thread-count</tt>. * <p> * If the JetS3t configuration property <tt>downloads.restoreLastModifiedDate</tt> is set * to true, any files created by this method will have their last modified date set according * to the value of the object's {@link Constants#METADATA_JETS3T_LOCAL_FILE_DATE} metadata * item. * * @param bucketName * name of the bucket containing the objects * @param downloadPackages * an array of download packages containing the object to be downloaded, and able to build * an output stream where the object's contents will be written to. * * @return * true if all the threaded tasks completed successfully, false otherwise. * @throws ServiceException */ public boolean downloadObjects(final String bucketName, final DownloadPackage[] downloadPackages) throws ServiceException { return downloadObjects(bucketName, downloadPackages, null); }
/** * A convenience method to download multiple objects from S3 to pre-existing output streams, which * is particularly useful for downloading objects to files. * * @param bucketName * name of the bucket containing the objects * @param downloadPackages * an array of download package objects that manage the output of data for an object. * @param errorPermitter * callback handler to decide which errors will cause a {@link ThrowableBearingStorageObject} * to pass through the system instead of raising an exception and aborting the operation. * * @throws ServiceException */ public void downloadObjects(String bucketName, final DownloadPackage[] downloadPackages, ErrorPermitter errorPermitter) throws ServiceException { StorageServiceEventAdaptor adaptor = new StorageServiceEventAdaptor(); (new ThreadedStorageService(service, adaptor)).downloadObjects( bucketName, downloadPackages, errorPermitter); throwError(adaptor); }
/** * A convenience method to download multiple objects from S3 to pre-existing output streams, which * is particularly useful for downloading objects to files. * * @param bucketName * name of the bucket containing the objects * @param downloadPackages * an array of download package objects that manage the output of data for an object. * @param errorPermitter * callback handler to decide which errors will cause a {@link ThrowableBearingStorageObject} * to pass through the system instead of raising an exception and aborting the operation. * * @throws ServiceException */ public void downloadObjects(String bucketName, final DownloadPackage[] downloadPackages, ErrorPermitter errorPermitter) throws ServiceException { StorageServiceEventAdaptor adaptor = new StorageServiceEventAdaptor(); (new ThreadedStorageService(service, adaptor)).downloadObjects( bucketName, downloadPackages, errorPermitter); throwError(adaptor); }
DownloadPackage[] downloadPackages = downloadPackagesList.toArray( new DownloadPackage[downloadPackagesList.size()]); (new ThreadedStorageService(storageService, serviceEventAdaptor)).downloadObjects( bucket.getName(), downloadPackages); serviceEventAdaptor.throwErrorIfPresent();
DownloadPackage[] downloadPackages = downloadPackagesList.toArray( new DownloadPackage[downloadPackagesList.size()]); (new ThreadedStorageService(storageService, serviceEventAdaptor)).downloadObjects( bucket.getName(), downloadPackages); serviceEventAdaptor.throwErrorIfPresent();
(new ThreadedStorageService(service, adaptor)).downloadObjects(bucketName, downloadPackages); throwError(adaptor); return reorderStorageObjects(originalObjectKeyNames, objectList);
(new ThreadedStorageService(service, adaptor)).downloadObjects(bucketName, downloadPackages); throwError(adaptor); return reorderStorageObjects(originalObjectKeyNames, objectList);