Package io.minio

Class PostPolicy

java.lang.Object
io.minio.PostPolicy

public class PostPolicy extends Object
Post policy information to be used to generate presigned post policy form-data. Condition elements and respective condition for Post policy is available here.
  • Constructor Details

  • Method Details

    • addEqualsCondition

      public void addEqualsCondition(String element, String value)
      Add equals condition of an element and value.
    • removeEqualsCondition

      public void removeEqualsCondition(String element)
      Remove previously set equals condition of an element.
    • addStartsWithCondition

      public void addStartsWithCondition(String element, String value)
      Add starts-with condition of an element and value. Value set to empty string does matching any content condition.
    • removeStartsWithCondition

      public void removeStartsWithCondition(String element)
      Remove previously set starts-with condition of an element.
    • addContentLengthRangeCondition

      public void addContentLengthRangeCondition(long lowerLimit, long upperLimit)
      Add content-length-range condition with lower and upper limits.
    • addContentLengthRangeCondition

      public void addContentLengthRangeCondition(int lowerLimit, int upperLimit)
      Add content-length-range condition with lower and upper limits.
    • removeContentLengthRangeCondition

      public void removeContentLengthRangeCondition()
      Remove previously set content-length-range condition.
    • formData

      public Map<String,String> formData(Credentials creds, String region) throws NoSuchAlgorithmException, InvalidKeyException
      Return form-data of this post policy. The returned map contains x-amz-algorithm, x-amz-credential, x-amz-security-token, x-amz-date, policy and x-amz-signature.
      Throws:
      NoSuchAlgorithmException
      InvalidKeyException
    • bucket

      public String bucket()