public class COSApi
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
COSApi.S3ObjectComparator |
Constructor and Description |
---|
COSApi() |
COSApi(boolean pool) |
COSApi(java.lang.String epurl,
java.lang.String accessKey,
java.lang.String secretKey) |
Modifier and Type | Method and Description |
---|---|
void |
cleanup() |
void |
createBucket(java.lang.String bucketName) |
void |
deleteBucket(java.lang.String bucketName) |
void |
deleteFile(java.lang.String bucketName,
java.lang.String fileName) |
boolean |
doesBucketExist(java.lang.String bucketName) |
boolean |
doesFileExist(java.lang.String bucketName,
java.lang.String fileName) |
java.util.List<java.lang.String> |
getAllBuckets(java.lang.String bucketPrefix) |
java.util.List<java.lang.String> |
getAllFiles(java.lang.String bucketName) |
java.util.List<com.amazonaws.services.s3.model.S3ObjectSummary> |
getAllS3ObjectsSortedByTime(java.lang.String bucketName) |
byte[] |
getFile(java.lang.String bucketName,
java.lang.String fileName) |
com.amazonaws.services.s3.model.S3Object |
getS3Object(java.lang.String bucketName,
java.lang.String fileName) |
byte[] |
getS3ObjectContent(com.amazonaws.services.s3.model.S3Object fileObject) |
java.lang.String |
getS3ObjectMimeType(com.amazonaws.services.s3.model.S3Object fileObject) |
void |
streamBinaryData(java.io.InputStream in,
java.io.OutputStream out) |
java.io.InputStream |
streamFile(java.lang.String bucketName,
java.lang.String fileName) |
java.lang.String |
uploadFile(java.lang.String bucketName,
java.lang.String fileName,
java.lang.String mimeType,
byte[] fileData) |
public static final MXLogger COSLOGGER
public COSApi()
public COSApi(boolean pool)
public COSApi(java.lang.String epurl, java.lang.String accessKey, java.lang.String secretKey)
public void createBucket(java.lang.String bucketName)
public boolean doesBucketExist(java.lang.String bucketName)
public boolean doesFileExist(java.lang.String bucketName, java.lang.String fileName)
public java.util.List<java.lang.String> getAllBuckets(java.lang.String bucketPrefix)
public java.util.List<java.lang.String> getAllFiles(java.lang.String bucketName)
public java.util.List<com.amazonaws.services.s3.model.S3ObjectSummary> getAllS3ObjectsSortedByTime(java.lang.String bucketName)
public java.lang.String uploadFile(java.lang.String bucketName, java.lang.String fileName, java.lang.String mimeType, byte[] fileData)
public byte[] getFile(java.lang.String bucketName, java.lang.String fileName) throws java.io.IOException
java.io.IOException
public com.amazonaws.services.s3.model.S3Object getS3Object(java.lang.String bucketName, java.lang.String fileName) throws java.io.IOException
java.io.IOException
public byte[] getS3ObjectContent(com.amazonaws.services.s3.model.S3Object fileObject) throws java.io.IOException
java.io.IOException
public java.lang.String getS3ObjectMimeType(com.amazonaws.services.s3.model.S3Object fileObject) throws java.io.IOException
java.io.IOException
public java.io.InputStream streamFile(java.lang.String bucketName, java.lang.String fileName) throws java.io.IOException
java.io.IOException
public void deleteFile(java.lang.String bucketName, java.lang.String fileName)
public void deleteBucket(java.lang.String bucketName) throws java.io.IOException
java.io.IOException
public void streamBinaryData(java.io.InputStream in, java.io.OutputStream out) throws java.lang.Exception
java.lang.Exception
public void cleanup()