Class PostPolicyV4

java.lang.Object
com.google.cloud.storage.PostPolicyV4

public final class PostPolicyV4 extends Object
Presigned V4 post policy. Instances of PostPolicyV4 include a URL and a map of fields that can be specified in an HTML form to submit a POST request to upload an object.

See POST Object for details of upload by using HTML forms.

See Storage.generateSignedPostPolicyV4(BlobInfo, long, TimeUnit, PostPolicyV4.PostFieldsV4, PostPolicyV4.PostConditionsV4, Storage.PostPolicyV4Option...) for example of usage.

  • Method Details

    • of

      public static PostPolicyV4 of(String url, Map<String,String> fields)
      Constructs PostPolicyV4 instance of the given URL and fields map.
      Parameters:
      url - URL for the HTTP POST request
      fields - HTML form fields
      Returns:
      constructed object
      Throws:
      IllegalArgumentException - if URL is malformed or fields are not valid
    • getUrl

      public String getUrl()
      Returns the URL for the HTTP POST request
    • getFields

      public Map<String,String> getFields()
      Returns the HTML form fields