Package com.amazon.s3

Examples of com.amazon.s3.AccessControlPolicy


      request.setCredential("TODO");
      request.setSignature("TODO");
      request.setTimestamp(Calendar.getInstance());
      request.setData(new DataHandler(file.toURL()));
     
      PutObjectInlineResponse response = serviceStub.putObjectInline(request);
        System.out.println("Object has been posted successfully. ETag: " + response.getPutObjectInlineResponse().getETag());
    } catch(Exception e) {
        System.out.println("Failed to execute object-put-inline due to " + e.getMessage());
    }
  }
View Full Code Here


        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());
        }
      } catch(Exception e) {
        System.out.println("Failed to execute bucket-delete due to " + e.getMessage());
      }
  }
View Full Code Here

        try {
            AmazonS3SoapBindingStub s3SoapBinding = getSoapBinding();
            Calendar timestamp = getTimeStamp( System.currentTimeMillis() );
            String signature = ServiceUtils.signWithHmacSha1(getAWSSecretKey(),
                Constants.SOAP_SERVICE_NAME + "GetObjectAccessControlPolicy" + convertDateToString(timestamp));
            AccessControlPolicy result = s3SoapBinding.getObjectAccessControlPolicy(
                bucketName, objectKey, getAWSAccessKey(),
                timestamp, signature, null);
            return convertAccessControlTypes(result);
        } catch (RuntimeException e) {
            throw e;
View Full Code Here

        try {
            AmazonS3SoapBindingStub s3SoapBinding = getSoapBinding();
            Calendar timestamp = getTimeStamp( System.currentTimeMillis() );
            String signature = ServiceUtils.signWithHmacSha1(getAWSSecretKey(),
                Constants.SOAP_SERVICE_NAME + "GetBucketAccessControlPolicy" + convertDateToString(timestamp));
            AccessControlPolicy result = s3SoapBinding.getBucketAccessControlPolicy(bucketName,
                getAWSAccessKey(), timestamp, signature, null);
            return convertAccessControlTypes(result);
        } catch (RuntimeException e) {
            throw e;
        } catch (Exception e) {
View Full Code Here

        try {
            AmazonS3SoapBindingStub s3SoapBinding = getSoapBinding();
            Calendar timestamp = getTimeStamp( System.currentTimeMillis() );
            String signature = ServiceUtils.signWithHmacSha1(getAWSSecretKey(),
                Constants.SOAP_SERVICE_NAME + "GetObjectAccessControlPolicy" + convertDateToString(timestamp));
            AccessControlPolicy result = s3SoapBinding.getObjectAccessControlPolicy(
                bucketName, objectKey, getAWSAccessKey(),
                timestamp, signature, null);
            return convertAccessControlTypes(result);
        } catch (RuntimeException e) {
            throw e;
View Full Code Here

        try {
            AmazonS3SoapBindingStub s3SoapBinding = getSoapBinding();
            Calendar timestamp = getTimeStamp( System.currentTimeMillis() );
            String signature = ServiceUtils.signWithHmacSha1(getAWSSecretKey(),
                Constants.SOAP_SERVICE_NAME + "GetBucketAccessControlPolicy" + convertDateToString(timestamp));
            AccessControlPolicy result = s3SoapBinding.getBucketAccessControlPolicy(bucketName,
                getAWSAccessKey(), timestamp, signature, null);
            return convertAccessControlTypes(result);
        } catch (RuntimeException e) {
            throw e;
        } catch (Exception e) {
View Full Code Here

        try {
            AmazonS3SoapBindingStub s3SoapBinding = getSoapBinding();
            Calendar timestamp = getTimeStamp( System.currentTimeMillis() );
            String signature = ServiceUtils.signWithHmacSha1(getAWSSecretKey(),
                Constants.SOAP_SERVICE_NAME + "GetObjectAccessControlPolicy" + convertDateToString(timestamp));
            AccessControlPolicy result = s3SoapBinding.getObjectAccessControlPolicy(
                bucketName, objectKey, getAWSAccessKey(),
                timestamp, signature, null);
            return convertAccessControlTypes(result);
        } catch (RuntimeException e) {
            throw e;
View Full Code Here

        try {
            AmazonS3SoapBindingStub s3SoapBinding = getSoapBinding();
            Calendar timestamp = getTimeStamp( System.currentTimeMillis() );
            String signature = ServiceUtils.signWithHmacSha1(getAWSSecretKey(),
                Constants.SOAP_SERVICE_NAME + "GetBucketAccessControlPolicy" + convertDateToString(timestamp));
            AccessControlPolicy result = s3SoapBinding.getBucketAccessControlPolicy(bucketName,
                getAWSAccessKey(), timestamp, signature, null);
            return convertAccessControlTypes(result);
        } catch (RuntimeException e) {
            throw e;
        } catch (Exception e) {
View Full Code Here

    }
  }

  public static String _call(PageContext pc , String url, Object objACL) throws PageException, IOException {
    S3Resource res=toS3Resource(pc,url,"StoreAddACL");
    AccessControlPolicy acp = res.getAccessControlPolicy();
   
    List<AccessControl> acl = acp.getAccessControlList();
    List<AccessControl> newACL = AccessControl.toAccessControlList(objACL);
   
    Iterator<AccessControl> it = newACL.iterator();
    while(it.hasNext()){
      acl.add(it.next());
View Full Code Here

    invoke(res, objACL);
    return null;
  }
 
  public static void invoke(S3Resource res, Object objACL) throws PageException, IOException {
    AccessControlPolicy acp = res.getAccessControlPolicy();
    List<AccessControl> acl = AccessControl.toAccessControlList(objACL);
    AccessControlPolicy.removeDuplicates(acl);
    acp.setAccessControlList(acl);
    res.setAccessControlPolicy(acp);
  }
View Full Code Here

TOP

Related Classes of com.amazon.s3.AccessControlPolicy

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.