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); } }
long maxUploadPartSize = properties.getLongProperty( "upload.max-part-size", MultipartUtils.MAX_OBJECT_SIZE); multipartUtils = new MultipartUtils(maxUploadPartSize);
long maxUploadPartSize = properties.getLongProperty( "upload.max-part-size", MultipartUtils.MAX_OBJECT_SIZE); multipartUtils = new MultipartUtils(maxUploadPartSize);
MultipartUtils multipartUtils = new MultipartUtils(maxPartSize);
MultipartUtils multipartUtils = new MultipartUtils(maxPartSize);
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);
MultipartUtils mpUtils = new MultipartUtils(maxSizeForAPartInBytes);