public class S3Util
extends java.lang.Object
Constructor and Description |
---|
S3Util() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
contentPath(java.lang.String key)
Helper function to create key from the container name for content
|
static void |
delete(java.lang.String key,
boolean isContent)
Deletes content with given key from Amazon S3
|
static boolean |
doesObjectExist(java.lang.String key,
boolean isContent)
Checks if the object exists in S3
|
static java.net.URL |
generatePresignedUrl(java.lang.String key,
java.lang.String fileName,
boolean isContent,
boolean download,
boolean inline)
Gets the requested content from Amazon S3
|
static EnhancedObjectContent |
get(java.lang.String key,
boolean isContent)
Gets the requested content from Amazon S3
|
static com.amazonaws.services.s3.model.ObjectMetadata |
getMetadata(java.lang.String key,
boolean isContent)
Gets the requested content metadata from Amazon S3
|
static S3Config |
getS3Config() |
static java.util.List<java.lang.String> |
listObjects(java.lang.String prefix)
List objects in the path given
|
static void |
put(java.lang.String key,
EnhancedObjectContent content,
java.lang.String mimeType,
boolean isContent)
Puts content into Amazon S3 with the given key
|
public static void put(java.lang.String key, EnhancedObjectContent content, java.lang.String mimeType, boolean isContent)
{String}
- key{EnhancedObjectContent}
- content{boolean}
- isContent - if true, will put the content in a content/
folderpublic static void delete(java.lang.String key, boolean isContent)
{String}
- key{boolean}
- isContent - if true, will delete from content/ folderpublic static EnhancedObjectContent get(java.lang.String key, boolean isContent)
{String}
- key{boolean}
- isContent - if true, will get content from content/ folderpublic static com.amazonaws.services.s3.model.ObjectMetadata getMetadata(java.lang.String key, boolean isContent)
{String}
- key{boolean}
- isContent - if true, will get content from content/ folderpublic static java.net.URL generatePresignedUrl(java.lang.String key, java.lang.String fileName, boolean isContent, boolean download, boolean inline)
{String}
- key - key of the file{String}
- filename - name returned (for downloads){boolean}
- isContent - if true, content will be fetched from the
content/ folder (abstraction){boolean}
- download - if true, the requested content will contain the
attachment header{boolean}
- inline - if true, the requested content will contain the
attachment header (supersedes download)public static boolean doesObjectExist(java.lang.String key, boolean isContent)
{String}
- key{boolean}
- isContentpublic static java.util.List<java.lang.String> listObjects(java.lang.String prefix)
{String}
- pathpublic static S3Config getS3Config()
public static java.lang.String contentPath(java.lang.String key)
{String}
- key