long maxUploadPartSize = properties.getLongProperty( "upload.max-part-size", MultipartUtils.MAX_OBJECT_SIZE); multipartUtils = new MultipartUtils(maxUploadPartSize); && multipartUtils.isFileLargerThanMaxPartSize(lazyObj.getFile())) multipartUtils.uploadObjects( bucket.getName(), (S3Service)storageService, objectsForMultipartUpload, serviceEventAdaptor);
throwServiceEventAdaptorErrorIfPresent(eventListener); partObjects = splitFileIntoObjectsByMaxPartSize( upload.getObjectKey(), object.getDataInputFile()); throwServiceEventAdaptorErrorIfPresent(eventListener); throwServiceEventAdaptorErrorIfPresent(eventListener); } catch (Exception e) { if (partObjects != null && partObjects.size() > 0) {
public void storeLargeFile(String key, File file, byte[] md5Hash) throws IOException { S3Object object = new S3Object(key); object.setDataInputFile(file); object.setContentType("binary/octet-stream"); object.setContentLength(file.length()); object.setServerSideEncryptionAlgorithm(serverSideEncryptionAlgorithm); if (md5Hash != null) { object.setMd5Hash(md5Hash); } List<StorageObject> objectsToUploadAsMultipart = new ArrayList<StorageObject>(); objectsToUploadAsMultipart.add(object); MultipartUtils mpUtils = new MultipartUtils(multipartBlockSize); try { mpUtils.uploadObjects(bucket.getName(), s3Service, objectsToUploadAsMultipart, null); } catch (Exception e) { handleException(e, key); } }
MultipartUtils multipartUtils = new MultipartUtils(maxPartSize); if (!multipartUtils.isFileLargerThanMaxPartSize(object.getDataInputFile())) { log.debug("Performing normal PUT upload for object with data <= " + maxPartSize); putObject(bucketName, object); List<S3Object> partObjects = multipartUtils.splitFileIntoObjectsByMaxPartSize( object.getKey(), object.getDataInputFile());
@Override protected void upload(String localFilePath, String remoteFilePath) throws Exception { S3Object file = new S3Object(new File(localFilePath)); file.setBucketName(bucket); file.setKey(remoteFilePath); file.setAcl(GSAccessControlList.REST_CANNED_BUCKET_OWNER_FULL_CONTROL); List objectsToUploadAsMultipart = new ArrayList(); objectsToUploadAsMultipart.add(file); mpUtils.uploadObjects(bucket, s3Service, objectsToUploadAsMultipart, null); if (!grantAcl.grantAcl(file)) { throw new RuntimeException("Failed to set Acl"); } } }
protected void initialize() { if (mpUtils == null) { // not injected mpUtils = new MultipartUtils(maxPartSize); } try { Jets3tProperties properties = new Jets3tProperties(); properties.setProperty("s3service.s3-endpoint", s3Endpoint); if (credentialsProvider.getCredentials() instanceof AWSSessionCredentials) { s3Service = new RestS3Service( new AWSSessionCredentialsAdapter(credentialsProvider), null, null, properties); } else { s3Service = new RestS3Service( new AWSCredentials( credentialsProvider.getCredentials().getAWSAccessKeyId(), credentialsProvider.getCredentials().getAWSSecretKey()), null, null, properties); } } catch (S3ServiceException e) { throw new RuntimeException(e); } grantAcl = new GrantAcl(s3Service, s3Acl, s3AclRetries == 0 ? 5 : s3AclRetries); notice.init(); }
MultipartUtils mpUtils = new MultipartUtils(maxSizeForAPartInBytes); mpUtils.uploadObjects(BUCKET_NAME, s3Service, objectsToUploadAsMultipart,
MultipartUtils multipartUtils = new MultipartUtils(maxPartSize); if (!multipartUtils.isFileLargerThanMaxPartSize(object.getDataInputFile())) { log.debug("Performing normal PUT upload for object with data <= " + maxPartSize); putObject(bucketName, object); List<S3Object> partObjects = multipartUtils.splitFileIntoObjectsByMaxPartSize( object.getKey(), object.getDataInputFile());
long maxUploadPartSize = properties.getLongProperty( "upload.max-part-size", MultipartUtils.MAX_OBJECT_SIZE); multipartUtils = new MultipartUtils(maxUploadPartSize); && multipartUtils.isFileLargerThanMaxPartSize(lazyObj.getFile())) multipartUtils.uploadObjects( bucket.getName(), (S3Service)storageService, objectsForMultipartUpload, serviceEventAdaptor);
MultipartUtils mpUtils = new MultipartUtils(maxSizeForAPartInBytes); mpUtils.uploadObjects(BUCKET_NAME, s3Service, objectsToUploadAsMultipart,
throwServiceEventAdaptorErrorIfPresent(eventListener); partObjects = splitFileIntoObjectsByMaxPartSize( upload.getObjectKey(), object.getDataInputFile()); throwServiceEventAdaptorErrorIfPresent(eventListener); throwServiceEventAdaptorErrorIfPresent(eventListener); } catch (Exception e) { if (partObjects != null && partObjects.size() > 0) {