Package com.amazon.s3

Examples of com.amazon.s3.User


    return request;
  }
 
  public static ListBucketResponse toListBucketResponse(S3ListBucketResponse engineResponse) {
    ListBucketResponse response = new ListBucketResponse();
    ListBucketResult result = new ListBucketResult();
    result.setName(engineResponse.getBucketName());
    result.setDelimiter(engineResponse.getDelimiter());
    result.setPrefix(engineResponse.getPrefix());
    result.setMarker(engineResponse.getMarker());
    result.setMaxKeys(engineResponse.getMaxKeys());
    result.setIsTruncated(engineResponse.isTruncated());
    result.setNextMarker(engineResponse.getNextMarker());
    result.setCommonPrefixes(toPrefixEntry(engineResponse.getCommonPrefixes()));
    result.setContents(toListEntry(engineResponse.getContents()));
    response.setListBucketResponse(result);
    return response;
  }
View Full Code Here


 
  private static ListEntry[] toListEntry(S3ListBucketObjectEntry[] engineEntries) {
    if(engineEntries != null) {
      ListEntry[] entries = new ListEntry[engineEntries.length];
      for(int i = 0; i < engineEntries.length; i++) {
        entries[i] = new ListEntry();
        entries[i].setETag(engineEntries[i].getETag());
        entries[i].setKey(engineEntries[i].getKey());
        entries[i].setLastModified(engineEntries[i].getLastModified());
        entries[i].setSize(engineEntries[i].getSize());
        entries[i].setStorageClass(StorageClass.STANDARD);
View Full Code Here

        request.setSourceBucketName(copyObject.getSourceBucket());
        request.setSourceKey(copyObject.getSourceKey());
        request.setDestinationBucketName(copyObject.getDestinationBucket());
        request.setDestinationKey(copyObject.getDestinationKey());
   
        MetadataDirective mdd = copyObject.getMetadataDirective();
        if (null != mdd) request.setDataDirective(mdd.getValue());

    request.setMetaEntries(toEngineMetaEntries(copyObject.getMetadata()));
    request.setAcl(toEngineAccessControlList(copyObject.getAccessControlList()));
   
    S3ConditionalHeaders conds = new S3ConditionalHeaders();
View Full Code Here

 
  private MetadataEntry[] toMetadataEntry(S3MetaDataEntry[] engineEntries) {
    if(engineEntries != null) {
      MetadataEntry[] entries = new MetadataEntry[engineEntries.length];
      for(int i = 0; i < engineEntries.length; i++) {
        entries[i] = new MetadataEntry();
        entries[i].setName(engineEntries[i].getName());
        entries[i].setValue(engineEntries[i].getValue());
      }
      return entries;
    }
View Full Code Here

          System.out.println("Please specify a command to run");
          System.exit(0);
        }
       
        try {
      serviceStub = new AmazonS3Stub(serviceUrl);
    } catch (AxisFault e) {
      System.out.println("Unable to initialize service stub");
      e.printStackTrace();
      System.exit(0);
    }
View Full Code Here

      System.out.println("Usage: bucket-create <bucket-name>");
      System.exit(0);
    }
   
      try {
        CreateBucket bucket = new CreateBucket();
        bucket.setBucket(args[1]);
        bucket.setAWSAccessKeyId( "TODO1" );
        bucket.setSignature("TODO2");
        bucket.setTimestamp(Calendar.getInstance());
       
        CreateBucketResponse response = serviceStub.createBucket(bucket);
        System.out.println("Bucket " + response.getCreateBucketReturn().getBucketName() + " has been created successfully");
      } catch(Exception e) {
        System.out.println("Failed to execute bucket-create due to " + e.getMessage());
View Full Code Here

        bucket.setBucket(args[1]);
        bucket.setAWSAccessKeyId( "TODO1" );
        bucket.setSignature("TODO2");
        bucket.setTimestamp(Calendar.getInstance());
       
        CreateBucketResponse response = serviceStub.createBucket(bucket);
        System.out.println("Bucket " + response.getCreateBucketReturn().getBucketName() + " has been created successfully");
      } catch(Exception e) {
        System.out.println("Failed to execute bucket-create due to " + e.getMessage());
      }
  }
View Full Code Here

      System.out.println("Usage: bucket-delete <bucket-name>");
      System.exit(0);
    }
   
      try {
        DeleteBucket request = new DeleteBucket();
        request.setBucket(args[1]);
        request.setSignature("TODO");
        request.setTimestamp(Calendar.getInstance());
       
        DeleteBucketResponse response = serviceStub.deleteBucket(request);
        Status status = response.getDeleteBucketResponse();
        if(status.getCode() == 200) {
          System.out.println("Bucket " + args[1] + " has been deleted successfully");
View Full Code Here

        DeleteBucket request = new DeleteBucket();
        request.setBucket(args[1]);
        request.setSignature("TODO");
        request.setTimestamp(Calendar.getInstance());
       
        DeleteBucketResponse response = serviceStub.deleteBucket(request);
        Status status = response.getDeleteBucketResponse();
        if(status.getCode() == 200) {
          System.out.println("Bucket " + args[1] + " has been deleted successfully");
        } else {
          System.out.println("Unable to delete bucket " + args[1] + " - " + status.getDescription());
        }
View Full Code Here

      System.out.println("Usage: object-delete -bucket=<bucket name> -name=<object name>");
      System.exit(0);
    }
   
    try {
      DeleteObject request = new DeleteObject();
      request.setAWSAccessKeyId("TODO");
      request.setBucket(params.get("bucket"));
      request.setKey(params.get("name"));
      request.setSignature("TODO");
      request.setCredential("TODO");
      request.setTimestamp(Calendar.getInstance());
     
      DeleteObjectResponse response = serviceStub.deleteObject(request);
      if(response.getDeleteObjectResponse().getCode() == 200)
        System.out.println("Object " + params.get("name") + " has been deleted successfully");
      else
View Full Code Here

TOP

Related Classes of com.amazon.s3.User

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.