use of com.amazonaws.services.s3.model.ObjectMetadata in project jackrabbit-oak by apache.
the class S3Backend method getMetadataRecord.
public DataRecord getMetadataRecord(String name) {
ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
try {
Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
ObjectMetadata meta = s3service.getObjectMetadata(bucket, addMetaKeyPrefix(name));
return new S3DataRecord(s3service, bucket, name, meta.getLastModified().getTime(), meta.getContentLength(), true);
} finally {
if (contextClassLoader != null) {
Thread.currentThread().setContextClassLoader(contextClassLoader);
}
}
}
use of com.amazonaws.services.s3.model.ObjectMetadata in project jackrabbit-oak by apache.
the class S3RequestDecorator method decorate.
/**
* Set encryption in {@link CopyObjectRequest}
*/
public CopyObjectRequest decorate(CopyObjectRequest request) {
switch(getDataEncryption()) {
case SSE_S3:
ObjectMetadata metadata = request.getNewObjectMetadata() == null ? new ObjectMetadata() : request.getNewObjectMetadata();
metadata.setSSEAlgorithm(ObjectMetadata.AES_256_SERVER_SIDE_ENCRYPTION);
request.setNewObjectMetadata(metadata);
break;
case NONE:
break;
}
return request;
}
Aggregations