javaamazon-web-servicescdnamazon-cloudfrontjets3t

JetS3t Java Object Invalidation


I've tried looking through the JetS3t API documentation but cannot seem to find the functionality to be able to invalidate existing files that we have on an Amazon CDN after they have been uploaded.

Does anyone know if this functionality does exist or if there is a suitable workaround?


Solution

  • I would suggest looking at Amazon CloudFront API. JetS3t was developed when the Amazon API was far more immature and less evolved than it is now. You'll find this feature is now supported. I refer you to: http://docs.aws.amazon.com/AmazonCloudFront/latest/APIReference/CreateInvalidation.html

    You need to create a new InvalidationBatch.

    This article explains how to achieve this: http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/services/cloudfront/model/CreateInvalidationRequest.html#CreateInvalidationRequest(java.lang.String,com.amazonaws.services.cloudfront.model.InvalidationBatch)

    public CreateInvalidationRequest(String distributionId, InvalidationBatch invalidationBatch)
    

    Constructs a new CreateInvalidationRequest object. Callers should use the setter or fluent setter (with...) methods to initialize any additional object members.

    Parameters:

    distributionId - The distribution's id.

    invalidationBatch - The batch information for the invalidation.