public final class S3RestUtils
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
S3RestUtils.RestCallable<T>
An interface representing a callable.
|
static class |
S3RestUtils.URIStatusNameComparator
Comparator based on uri nameļ¼ treat uri name as a Long number.
|
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
BUCKET_SEPARATOR
Bucket must be a directory directly under a mount point.
|
| Modifier and Type | Method and Description |
|---|---|
static <T> javax.ws.rs.core.Response |
call(java.lang.String resource,
S3RestUtils.RestCallable<T> callable)
Calls the given
S3RestUtils.RestCallable and handles any exceptions thrown. |
static void |
checkPathIsAlluxioDirectory(FileSystem fs,
java.lang.String bucketPath)
Check if a path in alluxio is a directory.
|
static void |
checkUploadId(FileSystem fs,
AlluxioURI multipartTemporaryDir,
long uploadId)
Check if uploadId equals directory id.
|
static java.lang.String |
getMultipartTemporaryDirForObject(java.lang.String bucketPath,
java.lang.String objectKey) |
static WritePType |
getS3WriteType() |
static java.lang.String |
parsePath(java.lang.String bucketPath)
Format bucket path.
|
static java.lang.String |
quoteETag(java.lang.String etag) |
static S3Exception |
toBucketS3Exception(java.lang.Exception exception,
java.lang.String resource)
Convert an exception to instance of
S3Exception. |
static S3Exception |
toObjectS3Exception(java.lang.Exception exception,
java.lang.String resource)
Convert an exception to instance of
S3Exception. |
static java.lang.String |
toS3Date(long epoch) |
public static final java.lang.String BUCKET_SEPARATOR
public static <T> javax.ws.rs.core.Response call(java.lang.String resource,
S3RestUtils.RestCallable<T> callable)
S3RestUtils.RestCallable and handles any exceptions thrown.T - the return type of the callableresource - the resource (bucket or object) to be operated oncallable - the callable to callpublic static java.lang.String getMultipartTemporaryDirForObject(java.lang.String bucketPath,
java.lang.String objectKey)
bucketPath - the bucket path like "/bucket", "/mount/point/bucket"objectKey - the object key like "img/2017/9/1/s3.jpg"public static java.lang.String toS3Date(long epoch)
epoch - the milliseconds from the epochpublic static java.lang.String quoteETag(java.lang.String etag)
etag - the entity tag to be used in the ETag field in the HTTP headerpublic static java.lang.String parsePath(java.lang.String bucketPath)
throws S3Exception
bucketPath - bucket pathS3Exceptionpublic static S3Exception toBucketS3Exception(java.lang.Exception exception, java.lang.String resource)
S3Exception.exception - Exception thrown when process s3 object rest requestresource - complete bucket pathS3Exceptionpublic static S3Exception toObjectS3Exception(java.lang.Exception exception, java.lang.String resource)
S3Exception.exception - Exception thrown when process s3 object rest requestresource - object complete pathS3Exceptionpublic static void checkPathIsAlluxioDirectory(FileSystem fs, java.lang.String bucketPath) throws S3Exception
fs - instance of FileSystembucketPath - bucket complete pathS3Exceptionpublic static void checkUploadId(FileSystem fs, AlluxioURI multipartTemporaryDir, long uploadId) throws S3Exception
fs - instance of FileSystemmultipartTemporaryDir - multipart upload tmp directoryuploadId - multipart upload IdS3Exceptionpublic static WritePType getS3WriteType()
Copyright © 2022. All Rights Reserved.