Package alluxio.proxy.s3
Class S3RestUtils
- java.lang.Object
-
- alluxio.proxy.s3.S3RestUtils
-
public final class S3RestUtils extends java.lang.ObjectUtilities for handling S3 REST calls.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceS3RestUtils.RestCallable<T>An interface representing a callable.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> javax.ws.rs.core.Responsecall(java.lang.String resource, S3RestUtils.RestCallable<T> callable)Calls the givenS3RestUtils.RestCallableand handles any exceptions thrown.static java.lang.StringgetMultipartTemporaryDirForObject(java.lang.String bucketPath, java.lang.String objectKey)static java.lang.StringquoteETag(java.lang.String etag)static java.lang.StringtoS3Date(long epoch)
-
-
-
Method Detail
-
call
public static <T> javax.ws.rs.core.Response call(java.lang.String resource, S3RestUtils.RestCallable<T> callable)Calls the givenS3RestUtils.RestCallableand handles any exceptions thrown.- Type Parameters:
T- the return type of the callable- Parameters:
resource- the resource (bucket or object) to be operated oncallable- the callable to call- Returns:
- the response object
-
getMultipartTemporaryDirForObject
public static java.lang.String getMultipartTemporaryDirForObject(java.lang.String bucketPath, java.lang.String objectKey)- Parameters:
bucketPath- the bucket path like "/bucket", "/mount/point/bucket"objectKey- the object key like "img/2017/9/1/s3.jpg"- Returns:
- the temporary directory used to hold parts of the object during multipart uploads
-
toS3Date
public static java.lang.String toS3Date(long epoch)
- Parameters:
epoch- the milliseconds from the epoch- Returns:
- the string representation of the epoch in the S3 date format
-
quoteETag
public static java.lang.String quoteETag(java.lang.String etag)
- Parameters:
etag- the entity tag to be used in the ETag field in the HTTP header- Returns:
- the etag surrounded by quotes, if etag is already surrounded by quotes, return itself
-
-