Package br.com.ingenieux.mojo.aws.util

Examples of br.com.ingenieux.mojo.aws.util.BeanstalkerS3Client


    if (!artifactFile.exists())
      throw new MojoFailureException(
          "Artifact File does not exists! (file=" + path);

    BeanstalkerS3Client client = new BeanstalkerS3Client(getAWSCredentials(),
        getClientConfiguration());
   
    client.setMultipartUpload(multipartUpload);
    client.setSilentUpload(silentUpload);

    if (StringUtils.isNotBlank(s3Region))
      client.setEndpoint(String.format("s3-%s.amazonaws.com", s3Region));

    getLog().info("Target Path: s3://" + s3Bucket + "/" + s3Key);
    getLog().info("Uploading artifact file: " + path);

    PutObjectResult result = client.putObject(new PutObjectRequest(s3Bucket, s3Key, artifactFile));
   
    getLog().info("Artifact Uploaded");

    return result;
  }
View Full Code Here


    if (!artifactFile.exists())
      throw new MojoFailureException(
          "Artifact File does not exists! (file=" + path);

    BeanstalkerS3Client client = new BeanstalkerS3Client(getAWSCredentials(),
        getClientConfiguration());
   
    client.setMultipartUpload(multipartUpload);

    if (StringUtils.isNotBlank(s3Region))
      client.setEndpoint(String.format("s3-%s.amazonaws.com", s3Region));

    getLog().info("Target Path: s3://" + s3Bucket + "/" + s3Key);
    getLog().info("Uploading artifact file: " + path);

    PutObjectResult result = client.putObject(new PutObjectRequest(s3Bucket, s3Key, artifactFile));
   
    getLog().info("Artifact Uploaded");

    return result;
  }
View Full Code Here

  @Override
  protected void configure() {
    super.configure();

    try {
      this.s3Client = new BeanstalkerS3Client(getAWSCredentials(),
          getClientConfiguration());
    } catch (MojoFailureException e) {
      throw new RuntimeException(e);
    }
  }
View Full Code Here

  @Override
  protected void configure() {
    super.configure();

    try {
      this.s3Client = new BeanstalkerS3Client(getAWSCredentials(),
          getClientConfiguration());
     
      /*
       * While we actually love multipart upload, and are not concerned about billing, we're not playing with cloudfront (yegor, I'm talking to you)
       */
 
View Full Code Here

  Integer daysToDelete;

  protected Object executeInternal() throws MojoExecutionException,
      MojoFailureException, AmazonServiceException,
      AmazonClientException, InterruptedException {
    BeanstalkerS3Client client = new BeanstalkerS3Client(getAWSCredentials(),
        getClientConfiguration());
   
    Calendar c = Calendar.getInstance();
   
    c.add(Calendar.DAY_OF_YEAR, -daysToDelete);
   
    Date since = c.getTime();
   
    client.deleteMultiparts(s3Bucket, since);
   
    return null;
  }
View Full Code Here

    if (!artifactFile.exists())
      throw new MojoFailureException(
          "Artifact File does not exists! (file=" + path);

    BeanstalkerS3Client client = new BeanstalkerS3Client(getAWSCredentials(),
        getClientConfiguration());
   
    client.setMultipartUpload(multipartUpload);

    if (StringUtils.isNotBlank(s3Region))
      client.setEndpoint(String.format("s3-%s.amazonaws.com", s3Region));

    getLog().info("Target Path: s3://" + s3Bucket + "/" + s3Key);
    getLog().info("Uploading artifact file: " + path);

    PutObjectResult result = client.putObject(new PutObjectRequest(s3Bucket, s3Key, artifactFile));
   
    getLog().info("Artifact Uploaded");

    return result;
  }
View Full Code Here

  Integer daysToDelete;

  protected Object executeInternal() throws MojoExecutionException,
      MojoFailureException, AmazonServiceException,
      AmazonClientException, InterruptedException {
    BeanstalkerS3Client client = new BeanstalkerS3Client(getAWSCredentials(),
        getClientConfiguration());
   
    Calendar c = Calendar.getInstance();
   
    c.add(Calendar.DAY_OF_YEAR, -daysToDelete);
   
    Date since = c.getTime();
   
    client.deleteMultiparts(s3Bucket, since);
   
    return null;
  }
View Full Code Here

    if (!artifactFile.exists())
      throw new MojoFailureException(
          "Artifact File does not exists! (file=" + path);

    BeanstalkerS3Client client = new BeanstalkerS3Client(getAWSCredentials(),
        getClientConfiguration());
   
    client.setMultipartUpload(multipartUpload);

    if (StringUtils.isNotBlank(s3Region))
      client.setEndpoint(String.format("s3-%s.amazonaws.com", s3Region));

    getLog().info("Target Path: s3://" + s3Bucket + "/" + s3Key);
    getLog().info("Uploading artifact file: " + path);

    PutObjectResult result = client.putObject(new PutObjectRequest(s3Bucket, s3Key, artifactFile));
   
    getLog().info("Artifact Uploaded");

    return result;
  }
View Full Code Here

  @Override
  protected void configure() {
    super.configure();

    try {
      this.s3Client = new BeanstalkerS3Client(getAWSCredentials(),
          getClientConfiguration());
     
      /*
       * While we actually love multipart upload, and are not concerned about billing, we're not playing with cloudfront (yegor, I'm talking to you)
       */
 
View Full Code Here

  String s3Region;
 
  protected Object executeInternal() throws MojoExecutionException,
      MojoFailureException, AmazonServiceException,
      AmazonClientException, InterruptedException {
    BeanstalkerS3Client client = new BeanstalkerS3Client(getAWSCredentials(),
        getClientConfiguration());
   
    client.deleteMultiparts(s3Bucket, new Date());
   
    return null;
  }
View Full Code Here

TOP

Related Classes of br.com.ingenieux.mojo.aws.util.BeanstalkerS3Client

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.