Examples of doesBucketExist()


Examples of com.amazonaws.services.s3.AmazonS3.doesBucketExist()

    AmazonS3 s3 = getS3Client(accessKey, secretKey);
    if (endpoint != null) {
      s3.setEndpoint(endpoint);
    }

    if (!s3.doesBucketExist(bucketName)) {
      throw new MojoExecutionException("Bucket doesn't exist: " + bucketName);
    }

    if (doNotUpload) {
      getLog().info(String.format("File %s would have be uploaded to s3://%s/%s (dry run)",
View Full Code Here

Examples of com.amazonaws.services.s3.AmazonS3.doesBucketExist()

    if (!source.exists()) {
      throw new MojoExecutionException("File doesn't exist: " + sourceFile);
    }

    AmazonS3 s3 = getS3Client(accessKey, secretKey);
    if (!s3.doesBucketExist(bucketName)) {
      throw new MojoExecutionException("Bucket doesn't exist: " + bucketName);
    }

    boolean success = upload(s3, bucketName, destinationFile, source);
    if (!success) {
View Full Code Here

Examples of com.amazonaws.services.s3.AmazonS3.doesBucketExist()

    AmazonS3 s3 = getS3Client(accessKey, secretKey);
    if (endpoint != null) {
      s3.setEndpoint(endpoint);
    }

    if (!s3.doesBucketExist(bucketName)) {
      throw new MojoExecutionException("Bucket doesn't exist: " + bucketName);
    }

    boolean success = upload(s3, bucketName, destinationFile, source);
    if (!success) {
View Full Code Here

Examples of com.amazonaws.services.s3.AmazonS3Client.doesBucketExist()

        AmazonS3Client s3service = Utils.openService(props);
        Backend backend = ds.getBackend();
        String bucket = ((S3Backend)backend).getBucket();
        LOG.info("delete bucket [" + bucket + "]");
        TransferManager tmx = new TransferManager(s3service);
        if (s3service.doesBucketExist(bucket)) {
            for (int i = 0; i < 3; i++) {
                tmx.abortMultipartUploads(bucket, startTime);
                ObjectListing prevObjectListing = s3service.listObjects(bucket);
                while (prevObjectListing != null ) {
                    List<DeleteObjectsRequest.KeyVersion> deleteList = new ArrayList<DeleteObjectsRequest.KeyVersion>();
View Full Code Here

Examples of com.amazonaws.services.s3.AmazonS3Client.doesBucketExist()

     * delete bucket.
     */
    public static void deleteBucket(final Properties prop) throws IOException {
        AmazonS3Client s3service = openService(prop);
        String bucketName = prop.getProperty(S3Constants.S3_BUCKET);
        if (!s3service.doesBucketExist(bucketName)) {
            return;
        }
        ObjectListing prevObjectListing = s3service.listObjects(bucketName);
        while (true) {
            List<DeleteObjectsRequest.KeyVersion> deleteList = new ArrayList<DeleteObjectsRequest.KeyVersion>();
View Full Code Here

Examples of com.amazonaws.services.s3.AmazonS3Client.doesBucketExist()

    Queue<Upload> uploads = new LinkedBlockingQueue<Upload>();

    try {
      // Check if S3 bucket exists
      getLog().debug("Checking whether bucket " + bucket + " exists");
      if (!uploadClient.doesBucketExist(bucket)) {
        getLog().error("Desired bucket '" + bucket + "' does not exist!");
        return;
      }

      getLog().debug("Collecting files to transfer from " + resources.getDirectory());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.