Skip to content

Commit feaffcd

Browse files
committed
Cleaning up
1 parent 39ad568 commit feaffcd

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

ds3_java_cli/src/main/java/com/spectralogic/ds3cli/ArgumentFactory.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ public final class ArgumentFactory {
5757
public static final Option PREFIX = Option.builder("p").hasArg(true).argName("prefix")
5858
.desc("Used with get operations to restore only objects whose names start with prefix "
5959
+ "and with put operations, to prepend a prefix to object name(s)").build();
60-
public static final Option SHOWVERSION = Option.builder("sv").argName("show-version").longOpt("show-version")
60+
public static final Option SHOW_VERSIONS = Option.builder("sv").argName("show-versions").longOpt("show-versions")
6161
.desc("Show version information").build();
62-
public static final Option VERSIONID = Option.builder().longOpt("versionId").desc("Version ID value").hasArg(true)
62+
public static final Option VERSION_ID = Option.builder().longOpt("version-id").desc("Version ID value").hasArg(true)
6363
.build();
6464
public static final Option OBJECT_NAME = Option.builder("o").hasArg(true).argName("objectFileName")
6565
.desc("The name of the object to be retrieved or stored").build();

ds3_java_cli/src/main/java/com/spectralogic/ds3cli/Arguments.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,8 +305,8 @@ public int getBufferSize() throws BadArgumentException {
305305

306306
// convenience getters for public options
307307
public String getBucket() { return this.getOptionValue(BUCKET.getOpt()); }
308-
public boolean getVersion() { return this.optionExists(SHOWVERSION.getOpt());}
309-
public String getVersionId() { return this.getOptionValue(VERSIONID.getLongOpt());}
308+
public boolean isShowVersions() { return this.optionExists(SHOW_VERSIONS.getOpt());}
309+
public String getVersionId() { return this.getOptionValue(VERSION_ID.getLongOpt());}
310310
public String getDirectory() { return this.getOptionValue(DIRECTORY.getOpt()); }
311311
public String getObjectName() { return this.getOptionValue(OBJECT_NAME.getOpt()); }
312312
public boolean isForce() { return this.optionExists(FORCE.getLongOpt()); }

ds3_java_cli/src/main/java/com/spectralogic/ds3cli/command/GetBucket.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,24 +35,24 @@
3535

3636
import static com.spectralogic.ds3cli.ArgumentFactory.BUCKET;
3737
import static com.spectralogic.ds3cli.ArgumentFactory.PREFIX;
38-
import static com.spectralogic.ds3cli.ArgumentFactory.SHOWVERSION;
38+
import static com.spectralogic.ds3cli.ArgumentFactory.SHOW_VERSIONS;
3939

4040
public 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();

ds3_java_cli/src/main/java/com/spectralogic/ds3cli/command/GetObject.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public class GetObject extends CliCommand<DefaultResult> {
5151

5252
private final static ImmutableList<Option> requiredArgs = ImmutableList.of(BUCKET, OBJECT_NAME);
5353
private final static ImmutableList<Option> optionalArgs = ImmutableList.of(DIRECTORY, SYNC,
54-
FORCE, NUMBER_OF_THREADS, PRIORITY, RANGE_OFFSET, RANGE_LENGTH, DISCARD, FILE_METADATA, VERSIONID);
54+
FORCE, NUMBER_OF_THREADS, PRIORITY, RANGE_OFFSET, RANGE_LENGTH, DISCARD, FILE_METADATA, VERSION_ID);
5555

5656
private String bucketName;
5757
private String objectName;

0 commit comments

Comments
 (0)