public class S3Utils extends Object
| Constructor and Description |
|---|
S3Utils() |
| Modifier and Type | Method and Description |
|---|---|
S3BasicFileAttributes |
getS3FileAttributes(S3Path s3Path)
getS3FileAttributes for the s3Path
|
com.amazonaws.services.s3.model.S3ObjectSummary |
getS3ObjectSummary(S3Path s3Path)
Get the
S3ObjectSummary that represent this Path or her first child if this path not exists |
S3PosixFileAttributes |
getS3PosixFileAttributes(S3Path s3Path)
get the S3PosixFileAttributes for a S3Path
|
Set<PosixFilePermission> |
toPosixFilePermission(com.amazonaws.services.s3.model.Permission permission)
transform a com.amazonaws.services.s3.model.Permission to a java.nio.file.attribute.PosixFilePermission
We use the follow rules:
- transform only to the Owner permission, S3 doesnt have concepts like owner, group or other so we map only to owner.
|
Set<PosixFilePermission> |
toPosixFilePermissions(List<com.amazonaws.services.s3.model.Grant> grants)
transform com.amazonaws.services.s3.model.Grant to java.nio.file.attribute.PosixFilePermission
|
S3BasicFileAttributes |
toS3FileAttributes(com.amazonaws.services.s3.model.S3ObjectSummary objectSummary,
String key)
transform S3ObjectSummary to S3FileAttributes
|
public com.amazonaws.services.s3.model.S3ObjectSummary getS3ObjectSummary(S3Path s3Path) throws NoSuchFileException
S3ObjectSummary that represent this Path or her first child if this path not existss3Path - S3PathS3ObjectSummaryNoSuchFileException - if not found the path and any childpublic S3BasicFileAttributes getS3FileAttributes(S3Path s3Path) throws NoSuchFileException
s3Path - S3Path mandatory not nullNoSuchFileExceptionpublic S3PosixFileAttributes getS3PosixFileAttributes(S3Path s3Path) throws NoSuchFileException
s3Path - Path mandatory not nullNoSuchFileException - if the Path doesnt existspublic Set<PosixFilePermission> toPosixFilePermissions(List<com.amazonaws.services.s3.model.Grant> grants)
grants - Set grants mandatory, must be not nulltoPosixFilePermission(Permission)public Set<PosixFilePermission> toPosixFilePermission(com.amazonaws.services.s3.model.Permission permission)
permission - Permission to map, mandatory must be not nullpublic S3BasicFileAttributes toS3FileAttributes(com.amazonaws.services.s3.model.S3ObjectSummary objectSummary, String key)
objectSummary - S3ObjectSummary mandatory not null, the real objectSummary with
exactly the same key than the key param or the immediate descendant
if it is a virtual directorykey - String the real key that can be exactly equal than the objectSummary orCopyright © 2018. All rights reserved.