Package org.apache.jackrabbit.aws.ext
Class Utils
- java.lang.Object
-
- org.apache.jackrabbit.aws.ext.Utils
-
public final class Utils extends Object
Amazon S3 utilities.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voiddeleteBucket(String bucketName)Delete S3 bucket.static com.amazonaws.services.s3.AmazonS3ClientopenService(Properties prop)Create AmazonS3Client from properties.static PropertiesreadConfig(String fileName)Read a configuration properties file.
-
-
-
Field Detail
-
DEFAULT_CONFIG_FILE
public static final String DEFAULT_CONFIG_FILE
- See Also:
- Constant Field Values
-
DEFAULT_AWS_BUCKET_REGION
public static final String DEFAULT_AWS_BUCKET_REGION
The default value AWS bucket region.- See Also:
- Constant Field Values
-
AWSDOTCOM
public static final String AWSDOTCOM
constants to define endpoint to various AWS region- See Also:
- Constant Field Values
-
S3
public static final String S3
- See Also:
- Constant Field Values
-
DOT
public static final String DOT
- See Also:
- Constant Field Values
-
DASH
public static final String DASH
- See Also:
- Constant Field Values
-
-
Method Detail
-
openService
public static com.amazonaws.services.s3.AmazonS3Client openService(Properties prop)
Create AmazonS3Client from properties.- Parameters:
prop- properties to configure @linkAmazonS3Client- Returns:
AmazonS3Client
-
deleteBucket
public static void deleteBucket(String bucketName) throws IOException
Delete S3 bucket. This method first deletes all objects from bucket and then delete empty bucket.- Parameters:
bucketName- the bucket name.- Throws:
IOException
-
readConfig
public static Properties readConfig(String fileName) throws IOException
Read a configuration properties file. If the file name ends with ";burn", the file is deleted after reading.- Parameters:
fileName- the properties file name- Returns:
- the properties
- Throws:
IOException- if the file doesn't exist
-
-