mirror of https://github.com/apache/jclouds.git
corrected imports
git-svn-id: http://jclouds.googlecode.com/svn/trunk@1432 3d8758e0-26b5-11de-8745-db77d3ebf521
This commit is contained in:
parent
2fb0c79e0f
commit
f5135f3868
|
@ -31,15 +31,13 @@ import org.jclouds.http.HttpHeaders;
|
|||
import org.jclouds.http.commands.callables.ReturnTrueIf2xx;
|
||||
import org.jclouds.logging.Logger;
|
||||
|
||||
import sun.util.logging.resources.logging;
|
||||
|
||||
import com.google.inject.Inject;
|
||||
import com.google.inject.assistedinject.Assisted;
|
||||
import com.google.inject.name.Named;
|
||||
|
||||
/**
|
||||
* A PUT request operation directed at a bucket URI with the "acl" parameter
|
||||
* sets the Access Control List (ACL) settings for that S3 item.
|
||||
* A PUT request operation directed at a bucket URI with the "acl" parameter sets the Access Control
|
||||
* List (ACL) settings for that S3 item.
|
||||
* <p />
|
||||
* To set a bucket or object's ACL, you must have WRITE_ACP or FULL_CONTROL access to the item.
|
||||
*
|
||||
|
@ -53,8 +51,7 @@ public class PutBucketAccessControlList extends S3FutureCommand<Boolean> {
|
|||
@Inject
|
||||
public PutBucketAccessControlList(@Named("jclouds.http.address") String amazonHost,
|
||||
ReturnTrueIf2xx callable, @Assisted("bucketName") String bucket,
|
||||
@Assisted AccessControlList acl)
|
||||
{
|
||||
@Assisted AccessControlList acl) {
|
||||
super("PUT", "/?acl", callable, amazonHost, bucket);
|
||||
|
||||
String aclPayload = "";
|
||||
|
@ -65,8 +62,7 @@ public class PutBucketAccessControlList extends S3FutureCommand<Boolean> {
|
|||
logger.error(e, "Unable to build XML document for Access Control List: " + acl);
|
||||
}
|
||||
getRequest().setPayload(aclPayload);
|
||||
getRequest().getHeaders().put(
|
||||
HttpHeaders.CONTENT_LENGTH, aclPayload.getBytes().length + "");
|
||||
getRequest().getHeaders().put(HttpHeaders.CONTENT_LENGTH, aclPayload.getBytes().length + "");
|
||||
}
|
||||
|
||||
}
|
|
@ -54,7 +54,6 @@ import org.jclouds.aws.s3.commands.options.ListBucketOptions;
|
|||
import org.jclouds.aws.s3.commands.options.PutBucketOptions;
|
||||
import org.jclouds.aws.s3.commands.options.PutObjectOptions;
|
||||
import org.jclouds.aws.s3.domain.AccessControlList;
|
||||
import org.jclouds.aws.s3.domain.CanonicalUser;
|
||||
import org.jclouds.aws.s3.domain.S3Bucket;
|
||||
import org.jclouds.aws.s3.domain.S3Object;
|
||||
import org.jclouds.aws.s3.domain.AccessControlList.CanonicalUserGrantee;
|
||||
|
@ -77,7 +76,7 @@ import com.google.common.collect.Sets;
|
|||
import com.thoughtworks.xstream.XStream;
|
||||
|
||||
/**
|
||||
* // TODO: Adrian: Document this!
|
||||
* Implementation of {@link S3Connection} which keeps all data in a local Map object.
|
||||
*
|
||||
* @author Adrian Cole
|
||||
*/
|
||||
|
@ -354,8 +353,8 @@ public class StubS3Connection implements S3Connection {
|
|||
}
|
||||
|
||||
if (options.getMaxKeys() != null) {
|
||||
SortedSet<S3Object.Metadata> contentsSlice = firstSliceOfSize(
|
||||
contents, Integer.parseInt(options.getMaxKeys()));
|
||||
SortedSet<S3Object.Metadata> contentsSlice = firstSliceOfSize(contents, Integer
|
||||
.parseInt(options.getMaxKeys()));
|
||||
returnVal.setMaxKeys(Integer.parseInt(options.getMaxKeys()));
|
||||
if (!contentsSlice.contains(contents.last())) {
|
||||
// Partial listing
|
||||
|
@ -549,12 +548,12 @@ public class StubS3Connection implements S3Connection {
|
|||
if (aclObj instanceof AccessControlList) {
|
||||
acl = (AccessControlList) aclObj;
|
||||
} else if (aclObj instanceof CannedAccessPolicy) {
|
||||
acl = AccessControlList.fromCannedAccessPolicy(
|
||||
(CannedAccessPolicy) aclObj, DEFAULT_OWNER_ID);
|
||||
acl = AccessControlList.fromCannedAccessPolicy((CannedAccessPolicy) aclObj,
|
||||
DEFAULT_OWNER_ID);
|
||||
} else if (aclObj == null) {
|
||||
// Default to private access policy
|
||||
acl = AccessControlList.fromCannedAccessPolicy(
|
||||
CannedAccessPolicy.PRIVATE, DEFAULT_OWNER_ID);
|
||||
acl = AccessControlList.fromCannedAccessPolicy(CannedAccessPolicy.PRIVATE,
|
||||
DEFAULT_OWNER_ID);
|
||||
}
|
||||
return acl;
|
||||
}
|
||||
|
@ -576,10 +575,10 @@ public class StubS3Connection implements S3Connection {
|
|||
}
|
||||
|
||||
/**
|
||||
* Replace any AmazonCustomerByEmail grantees with a somewhat-arbitrary canonical user
|
||||
* grantee, to match S3 which substitutes each email address grantee with that
|
||||
* user's corresponding ID. In short, although you can PUT email address grantees,
|
||||
* these are actually subsequently returned by S3 as canonical user grantees.
|
||||
* Replace any AmazonCustomerByEmail grantees with a somewhat-arbitrary canonical user grantee,
|
||||
* to match S3 which substitutes each email address grantee with that user's corresponding ID. In
|
||||
* short, although you can PUT email address grantees, these are actually subsequently returned
|
||||
* by S3 as canonical user grantees.
|
||||
*
|
||||
* @param acl
|
||||
* @return
|
||||
|
@ -589,8 +588,8 @@ public class StubS3Connection implements S3Connection {
|
|||
// the acl's owner ID as the surrogate replacement.
|
||||
for (Grant grant : acl.getGrants()) {
|
||||
if (grant.getGrantee() instanceof EmailAddressGrantee) {
|
||||
grant.setGrantee(new CanonicalUserGrantee(
|
||||
acl.getOwner().getId(), acl.getOwner().getDisplayName()));
|
||||
grant.setGrantee(new CanonicalUserGrantee(acl.getOwner().getId(), acl.getOwner()
|
||||
.getDisplayName()));
|
||||
}
|
||||
}
|
||||
return acl;
|
||||
|
@ -606,8 +605,7 @@ public class StubS3Connection implements S3Connection {
|
|||
}
|
||||
|
||||
public Future<Boolean> putObjectACL(final String bucket, final String objectKey,
|
||||
final AccessControlList acl)
|
||||
{
|
||||
final AccessControlList acl) {
|
||||
return new FutureBase<Boolean>() {
|
||||
public Boolean get() throws InterruptedException, ExecutionException {
|
||||
keyToAcl.put(bucket + "/" + objectKey, sanitizeUploadedACL(acl));
|
||||
|
|
Loading…
Reference in New Issue