S3B2 Java Library Edition

This edition of S3B2 allows you to perform S3B2 operation from command-line using Java.

Usage

 
java -classpath ./.;S3B2.jar;commons-cli-1.0.jar com.sheelapps.s3.S3B2Main -h
 
usage: SheelApps S3B2 Command Line Tool - version 1.0b
 -a,--access-key <access-key>   s3 access key.
 -s,--secret-key <secret-key>   s3 secret key.
 -b,--bucket <bucket>           s3 bucket.
 -h,--help                      print this message
 -ld,--localdir <dir>           local directory.
 -lf,--localfile <file>         local file.
 -m,--modified                  Modified only
 -o,--operation <operation>     operation to perform. Valid operation
                                names are download, upload, list, create and del
 -rd,--remotedir <dir>          s3 directory.

 -rf,--remotefile <file>        s3 object key.
 Note: -b (except in list all buckets, see below), -a, and -s are always
required.
Operation examples :
Download a file : -o download  -ld c:/temp -rf abc.txt
Download a file : -o download  -ld c:/temp -rf dir1/abc.txt

Download a directory : -o download -ld c:/temp -rd dir1
Download a directory : -o download  -ld c:/temp -rd dir1/subdir2
Upload a file : -o upload -lf c:/temp/test.txt -rd dir1
Upload a root-level file : -o upload -lf c:/temp/test.txt
Upload a directory to dir1 : -o upload -ld c:/temp/ -rd dir1
Upload a root-level directory : -o upload -ld c:/temp/

List all buckets : -o list
List bucket : -o list -b bucket-name
List directory : -o list -rd dir1
Create bucket : -o create -b bucket-name
Create directory : -o create -rd dir1
Create directory : -o create -rd dir1/subdir1

Delete a bucket : -o delete -b bucket-name
Delete a file : -o delete -rf abc.txt
Delete a file : -o delete -rf dir1/abc.txt
Delete a directory : -o delete -rd dir1
 

Examples :

Upload a directory (recursive and modified files only)

java -classpath ./.;S3B2.jar;commons-cli-1.0.jar com.sheelapps.s3.S3B2Main -a
 <access-key> -s <secret-key> -b <bucket> -o upload -ld c:/users/data -rd users -m
 
 

Above command will upload local directory "c:/users/data" to "<bucket>/users/data" directory.

List all files in a bucket

java -classpath ./.;S3B2.jar;commons-cli-1.0.jar com.sheelapps.s3.S3B2Main -a
 <access-key> -s <secret-key> -b <bucket> -o list
 
 

Send email at sheel@sheelapps.com for licensing and pricing.