Package org.filestack
Class Policy.Builder
java.lang.Object
org.filestack.Policy.Builder
- Enclosing class:
Policy
Builds new
Policy
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionEncodes the json policy and signs it using the app secret.Add a call that this policy is allowed to make.Restrict containers a file can be uploaded to.Set when the policy will expire.Give the policy full access and a one year expiry.Restrict access to a single file handle for all calls that act on a specific handle.Set the max file size in bytes that can be uploaded.Set the min file size in bytes that can be uploaded.Restrict paths a file can be uploaded to.Restrict external transformations to certain URLs.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
expiry
Set when the policy will expire.- Parameters:
expiry
- in UNIX time
-
calls
Add a call that this policy is allowed to make. A policy without any call permissions specified is permitted to make all calls except for exif, which needs to be explicitly included in a policy in order to be allowed.- Parameters:
calls
- can be pick, read, stat, write, writeUrl, store, convert, remove, or exif
-
handle
Restrict access to a single file handle for all calls that act on a specific handle. -
url
Restrict external transformations to certain URLs.- Parameters:
regex
- regular expression matching allowed urls
-
maxSize
Set the max file size in bytes that can be uploaded. Default is no limit. -
minSize
Set the min file size in bytes that can be uploaded. Defaults to 0. -
path
Restrict paths a file can be uploaded to. Prevents a user from storing files to different paths. Does not prevent a user from reading content from different paths. Defaults to allowing any path ('.*').- Parameters:
path
- regular expression matching allowed paths
-
container
Restrict containers a file can be uploaded to. Prevents a user from storing files to different containers. Does not prevent a user from reading content from different containers. Defaults to allowing any path ('.*').- Parameters:
container
- regular expression matching allowed paths
-
giveFullAccess
Give the policy full access and a one year expiry. -
build
Encodes the json policy and signs it using the app secret. Do not include the app secret in client-side code.
-