public void deleteObject(String bucket, String key) { amazonS3.deleteObject(bucket, key); } }
public boolean doesObjectExist(String bucket, String objectName) { return amazonS3.doesObjectExist(bucket, objectName); }
public AccessControlList getBucketAcl(String bucket) { return amazonS3.getBucketAcl(bucket); }
@Override public AmazonS3 apply(AmazonS3ClientParamsWrapper params) { return new AmazonS3Client(params); } };
@Override protected ObjectListing computeNext(ObjectListing previous) { if (!previous.isTruncated()) { return null; } return s3.listNextBatchOfObjects(previous); } };
/** * @return Create new instance of builder with all defaults set. */ public static AmazonS3ClientBuilder standard() { return new AmazonS3ClientBuilder().withCredentials(new S3CredentialsProviderChain()); }
private static void deleteFile(ParameterTool params) { final String bucket = params.getRequired("bucket"); final String s3file = params.getRequired("s3file"); AmazonS3ClientBuilder.defaultClient().deleteObject(bucket, s3file); }
/** * <p> * Override the default S3 client options for this client. Also set the * endpoint to s3-accelerate if such is specified in the S3 client options. * </p> * * @param clientOptions * The S3 client options to use. */ @Override public synchronized void setS3ClientOptions(S3ClientOptions clientOptions) { checkMutability(); this.clientOptions = new S3ClientOptions(clientOptions); }
public ListObjectsV2Result listObjectsV2(ListObjectsV2Request request) { return amazonS3.listObjectsV2(request); }
@Override public void setObjectAcl(String bucketName, String key, CannedAccessControlList acl) throws SdkClientException, AmazonServiceException { setObjectAcl(bucketName, key, null, acl); }
private boolean bucketRegionShouldBeCached(Request<?> request) { return clientOptions.isForceGlobalBucketAccessEnabled() || noExplicitRegionProvided(request); }
/** * <p>Enables dualstack mode on clients built with the builder.</p> * @return This object for method chaining. */ public Subclass enableDualstack() { setDualstackEnabled(Boolean.TRUE); return getSubclass(); }
/** * @return a new S3ClientOptions builder. */ public static Builder builder() { return new Builder(); }
/** * @return Create new instance of builder with all defaults set. */ public static AmazonS3EncryptionClientBuilder standard() { return new AmazonS3EncryptionClientBuilder(); }
/** * Sets the KMS implementation to be used throughout the crypto process * @param kms an {@link AWSKMS} implementation (e.g. {@link com.amazonaws.services.kms.AWSKMSClient}) * @return this object for method chaining */ public AmazonS3EncryptionClientBuilder withKmsClient(AWSKMS kms) { setKms(kms); return this; }
@Override public void setObjectAcl(String bucketName, String key, AccessControlList acl) throws SdkClientException, AmazonServiceException { setObjectAcl(bucketName, key, null, acl); }
@Override public URL generatePresignedUrl(String bucketName, String key, Date expiration) throws SdkClientException { return generatePresignedUrl(bucketName, key, expiration, HttpMethod.GET); }
@Override public void restoreObject(RestoreObjectRequest restoreObjectRequest) throws AmazonServiceException { restoreObjectV2(restoreObjectRequest); }
private boolean deleteObject(String key) { try { s3.deleteObject(getBucketName(uri), key); return true; } catch (AmazonClientException e) { return false; } }