3535
3636import static com .spectralogic .ds3cli .ArgumentFactory .BUCKET ;
3737import static com .spectralogic .ds3cli .ArgumentFactory .PREFIX ;
38- import static com .spectralogic .ds3cli .ArgumentFactory .SHOWVERSION ;
38+ import static com .spectralogic .ds3cli .ArgumentFactory .SHOW_VERSIONS ;
3939
4040public class GetBucket extends CliCommand <GetBucketResult > {
4141
4242 private final static ImmutableList <Option > requiredArgs = ImmutableList .of (BUCKET );
43- private final static ImmutableList <Option > optionalArgs = ImmutableList .of (PREFIX , SHOWVERSION );
43+ private final static ImmutableList <Option > optionalArgs = ImmutableList .of (PREFIX , SHOW_VERSIONS );
4444
4545 private String bucket ;
4646 private String prefix ;
47- private boolean version ;
47+ private boolean showVersion ;
4848
4949 @ Override
5050 public CliCommand init (final Arguments args ) throws Exception {
5151 processCommandOptions (requiredArgs , optionalArgs , args );
5252
5353 this .bucket = args .getBucket ();
5454 this .prefix = args .getPrefix ();
55- this .version = args .getVersion ();
55+ this .showVersion = args .isShowVersions ();
5656 return this ;
5757 }
5858
@@ -62,15 +62,15 @@ public GetBucketResult call() throws Exception {
6262 try {
6363 // GetBucketDetail to get both name and id
6464 GetBucketRequest getBucketRequest = new GetBucketRequest (bucket );
65- getBucketRequest .withVersions (version );
65+ getBucketRequest .withVersions (showVersion );
6666 getBucketRequest .withPrefix (prefix );
6767 final GetBucketSpectraS3Request getBucketSpectraS3Request = new GetBucketSpectraS3Request (bucket );
6868 final GetBucketSpectraS3Response response = getClient ().getBucketSpectraS3 (getBucketSpectraS3Request );
6969 final Bucket bucketDetails = response .getBucketResult ();
7070 final GetBucketResponse bucket = getClient ().getBucket (getBucketRequest );
7171
7272 final List <Contents > contents ;
73- if (version ) {
73+ if (showVersion ) {
7474 contents = bucket .getListBucketResult ().getVersionedObjects ();
7575 } else {
7676 contents = bucket .getListBucketResult ().getObjects ();
@@ -91,7 +91,7 @@ public View<GetBucketResult> getView() {
9191 case JSON :
9292 return new DataView ();
9393 default :
94- if (version ) {
94+ if (showVersion ) {
9595 return new com .spectralogic .ds3cli .views .cli .GetVersionedBucketView ();
9696 } else {
9797 return new com .spectralogic .ds3cli .views .cli .GetBucketView ();
0 commit comments