Package com.workfusion.rpa.helpers
Class S3
java.lang.Object
com.workfusion.rpa.helpers.S3
This class adds static methods for work this S3.
- Samples
downloadFileS3(s3EndpointUrl, accessKey, secretKey, bucket, s3Key, targetPath);uploadFileS3(s3EndpointUrl, accessKey, secretKey, bucket, s3Key, sourcePath, strategy);createFolderS3(s3EndpointUrl, accessKey, secretKey, bucket, s3Key);deleteFolderFileS3(s3EndpointUrl, accessKey, secretKey, bucket, s3Key);directoryListS3(s3EndpointUrl, accessKey, secretKey, bucket, s3Key);
Driver Type: Desktop
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic StringcreateFolderS3(String s3EndpointUrl, String signerType, String accessKey, String secretKey, String bucket, String s3Key) Create folder on S3 bucketstatic voiddeleteFolderFileS3(String s3EndpointUrl, String signerType, String accessKey, String secretKey, String bucket, String s3Key) Delete folder or file on S3 bucketdirectoryListS3(String s3EndpointUrl, String signerType, String accessKey, String secretKey, String bucket, String s3Key) Get list of folders and files from S# bucketstatic StringdownloadFileS3(String s3EndpointUrl, String signerType, String accessKey, String secretKey, String bucket, String s3Key, String targetPath) Download file from S3 bucket to local filestatic StringdownloadFileS3(String s3EndpointUrl, String signerType, String accessKey, String secretKey, String bucket, String s3Key, String targetPath, long timeout) Download file from S3 bucket to local filestatic StringuploadFileS3(String s3EndpointUrl, String signerType, String accessKey, String secretKey, String bucket, String s3Key, String sourcePath, S3OverwriteStrategy strategy) Upload file to S3 bucket from local filestatic StringuploadFileS3(String s3EndpointUrl, String signerType, String accessKey, String secretKey, String bucket, String s3Key, String sourcePath, S3OverwriteStrategy strategy, long timeout) Upload file to S3 bucket from local file
-
Field Details
-
S3_TIMEOUT
public static final long S3_TIMEOUT
-
-
Method Details
-
downloadFileS3
public static String downloadFileS3(String s3EndpointUrl, String signerType, String accessKey, String secretKey, String bucket, String s3Key, String targetPath) Download file from S3 bucket to local file
Driver Type: Desktop
- Parameters:
s3EndpointUrl- string representation of url to S3accessKey- string representation of access key to S3 bucketsecretKey- string representation of secret key to S3 bucketbucket- string representation name of buckets3Key- string representation path of file on buckettargetPath- string representation path for destination file- Returns:
- absolute path to local file
-
downloadFileS3
public static String downloadFileS3(String s3EndpointUrl, String signerType, String accessKey, String secretKey, String bucket, String s3Key, String targetPath, long timeout) Download file from S3 bucket to local file
Driver Type: Desktop
- Parameters:
s3EndpointUrl- string representation of url to S3accessKey- string representation of access key to S3 bucketsecretKey- string representation of secret key to S3 bucketbucket- string representation name of buckets3Key- string representation path of file on buckettargetPath- string representation path for destination filetimeout- in milliseconds how long wait to response- Returns:
- absolute path to local file
-
uploadFileS3
public static String uploadFileS3(String s3EndpointUrl, String signerType, String accessKey, String secretKey, String bucket, String s3Key, String sourcePath, S3OverwriteStrategy strategy) Upload file to S3 bucket from local file
Driver Type: Desktop
- Parameters:
s3EndpointUrl- string representation of url to S3accessKey- string representation of access key to S3 bucketsecretKey- string representation of secret key to S3 bucketbucket- string representation name of buckets3Key- string representation path of file on bucketsourcePath- string representation path for source filestrategy- enum for values OVERWRITE, SKIP and FAIL- Returns:
- link to uploaded file
-
uploadFileS3
public static String uploadFileS3(String s3EndpointUrl, String signerType, String accessKey, String secretKey, String bucket, String s3Key, String sourcePath, S3OverwriteStrategy strategy, long timeout) Upload file to S3 bucket from local file
Driver Type: Desktop
- Parameters:
s3EndpointUrl- string representation of url to S3accessKey- string representation of access key to S3 bucketsecretKey- string representation of secret key to S3 bucketbucket- string representation name of buckets3Key- string representation path of file on bucketsourcePath- string representation path for source filestrategy- enum for values OVERWRITE, SKIP and FAILtimeout- in milliseconds how long wait to response- Returns:
- link to uploaded file
-
createFolderS3
public static String createFolderS3(String s3EndpointUrl, String signerType, String accessKey, String secretKey, String bucket, String s3Key) Create folder on S3 bucket
Driver Type: Desktop
- Parameters:
s3EndpointUrl- string representation of url to S3accessKey- string representation of access key to S3 bucketsecretKey- string representation of secret key to S3 bucketbucket- string representation name of buckets3Key- string representation path of folder on bucket- Returns:
- link to created folder
-
deleteFolderFileS3
public static void deleteFolderFileS3(String s3EndpointUrl, String signerType, String accessKey, String secretKey, String bucket, String s3Key) Delete folder or file on S3 bucket
Driver Type: Desktop
- Parameters:
s3EndpointUrl- string representation of url to S3accessKey- string representation of access key to S3 bucketsecretKey- string representation of secret key to S3 bucketbucket- string representation name of buckets3Key- string representation path of folder or file on bucket
-
directoryListS3
public static List<Object> directoryListS3(String s3EndpointUrl, String signerType, String accessKey, String secretKey, String bucket, String s3Key) Get list of folders and files from S# bucket
Driver Type: Desktop
- Parameters:
s3EndpointUrl- string representation of url to S3accessKey- string representation of access key to S3 bucketsecretKey- string representation of secret key to S3 bucketbucket- string representation name of buckets3Key- string representation path of root folder or file on bucket
-