Package org.jclouds.s3.options
Class CopyObjectOptions
java.lang.Object
org.jclouds.http.options.BaseHttpRequestOptions
org.jclouds.s3.options.CopyObjectOptions
- All Implemented Interfaces:
HttpRequestOptions
Contains options supported in the REST API for the COPY object operation.
Usage
The recommended way to instantiate a CopyObjectOptions object is to statically import CopyObjectOptions.Builder.* and invoke a static creation method followed by an instance mutator (if needed):
import static org.jclouds.s3.commands.options.CopyObjectOptions.Builder.*
S3Client connection = // get connection
Multimapinvalid input: '<'String,String> metadata = LinkedHashMultimap.create();
metadata.put("x-amz-meta-adrian", "foo");
// this will copy the object, provided it wasn't modified since yesterday.
// it will not use metadata from the source, and instead use what we pass in.
Futureinvalid input: '<'S3Object.Metadata> object = connection.copyObject("sourceBucket", "objectName",
"destinationBucket", "destinationName",
overrideMetadataWith(meta).
ifSourceModifiedSince(new Date().minusDays(1))
);
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsFields inherited from class org.jclouds.http.options.BaseHttpRequestOptions
formParameters, headers, pathSuffix, payload, queryParameters
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionBuilds headers representing options.cacheControl
(String cacheControl) contentDisposition
(String contentDisposition) contentEncoding
(String contentEncoding) contentLanguage
(String contentLanguage) contentType
(String contentType) getAcl()
For use in the request header: x-amz-copy-source-if-matchFor use in the header x-amz-copy-source-if-unmodified-sinceFor use in the request header: x-amz-copy-source-if-none-matchFor use in the header x-amz-copy-source-if-modified-sinceWhen not null, contains the header [x-amz-copy-source-if-unmodified-since] -> [REPLACE] and metadata headers passed in from the users.The object should not have a eTag hash corresponding with the parametereTag
.ifSourceETagMatches
(String eTag) The object's eTag hash should match the parametereTag
.ifSourceModifiedSince
(Date ifModifiedSince) Only return the object if it has changed since this time.ifSourceUnmodifiedSince
(Date ifUnmodifiedSince) Only return the object if it hasn't changed since this time.Override the default ACL (private) with the specified one.overrideMetadataWith
(Map<String, String> metadata) Use the provided metadata instead of what is on the source object.void
setHeaderTag
(String headerTag) void
setMetadataPrefix
(String metadataPrefix) Methods inherited from class org.jclouds.http.options.BaseHttpRequestOptions
buildFormParameters, buildPathSuffix, buildQueryParameters, buildStringPayload, equals, getFirstFormOrNull, getFirstHeaderOrNull, getFirstQueryOrNull, hashCode, replaceHeader, toString
-
Field Details
-
NONE
-
-
Constructor Details
-
CopyObjectOptions
public CopyObjectOptions()
-
-
Method Details
-
setMetadataPrefix
-
setHeaderTag
-
overrideAcl
Override the default ACL (private) with the specified one.- See Also:
-
getAcl
- See Also:
-
getIfModifiedSince
For use in the header x-amz-copy-source-if-unmodified-since Copies the object if it hasn't been modified since the specified time; otherwise returns a 412 (precondition failed). This header can be used with x-amz-copy-source-if-match, but cannot be used with other conditional copy headers.- Returns:
- valid HTTP date
- See Also:
-
getIfUnmodifiedSince
For use in the header x-amz-copy-source-if-modified-since Copies the object if it has been modified since the specified time; otherwise returns a 412 (failed condition). This header can be used with x-amz-copy-source-if-none-match, but cannot be used with other conditional copy headers.- Returns:
- valid HTTP date
- See Also:
-
getIfMatch
For use in the request header: x-amz-copy-source-if-match Copies the object if its payload tag (ETag) matches the specified tag; otherwise return a 412 (precondition failed). This header can be used with x-amz-copy-source-if-unmodified-since, but cannot be used with other conditional copy headers.- See Also:
-
getIfNoneMatch
For use in the request header: x-amz-copy-source-if-none-match Copies the object if its payload tag (ETag) is different than the specified Etag; otherwise returns a 412 (failed condition). This header can be used with x-amz-copy-source-if-modified-since, but cannot be used with other conditional copy headers.- See Also:
-
getMetadata
When not null, contains the header [x-amz-copy-source-if-unmodified-since] -> [REPLACE] and metadata headers passed in from the users.- See Also:
-
ifSourceModifiedSince
Only return the object if it has changed since this time. Not compatible withifSourceETagMatches(String)
orifSourceUnmodifiedSince(Date)
-
ifSourceUnmodifiedSince
Only return the object if it hasn't changed since this time. Not compatible withifSourceETagDoesntMatch(String)
orifSourceModifiedSince(Date)
-
ifSourceETagMatches
The object's eTag hash should match the parametereTag
. Not compatible withifSourceETagDoesntMatch(String)
orifSourceModifiedSince(Date)
- Parameters:
eTag
- hash representing the payload
-
ifSourceETagDoesntMatch
The object should not have a eTag hash corresponding with the parametereTag
. Not compatible withifSourceETagMatches(String)
orifSourceUnmodifiedSince(Date)
- Parameters:
eTag
- hash representing the payload
-
buildRequestHeaders
Description copied from class:BaseHttpRequestOptions
Builds headers representing options.- Specified by:
buildRequestHeaders
in interfaceHttpRequestOptions
- Overrides:
buildRequestHeaders
in classBaseHttpRequestOptions
- Returns:
- multimap that may contain headers.
-
cacheControl
-
contentDisposition
-
contentEncoding
-
contentLanguage
-
contentType
-
overrideMetadataWith
Use the provided metadata instead of what is on the source object.
-