Skip to content

Commit 0edafb6

Browse files
committed
Checking if version id is null
1 parent 61079bb commit 0edafb6

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

ds3-sdk-integration/src/main/java/com/spectralogic/ds3client/integration/Util.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public static void forceCleanupBucketsOnBP(final Ds3Client client) throws IOExce
7373
final GetBucketsSpectraS3Request request = new GetBucketsSpectraS3Request();
7474
final GetBucketsSpectraS3Response response = client.getBucketsSpectraS3(request);
7575

76-
for (Bucket bucket : response.getBucketListResult().getBuckets()) {
76+
for (final Bucket bucket : response.getBucketListResult().getBuckets()) {
7777
cancelAllJobsForBucket(client, bucket.getName());
7878
client.deleteBucketSpectraS3(new DeleteBucketSpectraS3Request(bucket.getName()).withForce(true));
7979
}

ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/GetJobPartialBlobTransferMethod.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,9 @@ private GetObjectRequest makeGetObjectRequest(final SeekableByteChannel seekable
9292
jobId,
9393
blob.getOffset());
9494

95-
getObjectRequest.withVersionId(blob.getVersionId());
95+
if (blob.getVersionId() != null) {
96+
getObjectRequest.withVersionId(blob.getVersionId());
97+
}
9698
getObjectRequest.withByteRanges(blobRanges);
9799

98100
return getObjectRequest;

ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/GetJobTransferMethod.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,9 @@ private GetObjectRequest makeGetObjectRequest(final SeekableByteChannel seekable
8686
jobId,
8787
blob.getOffset());
8888

89-
getObjectRequest.withVersionId(jobPart.getBlob().getVersionId());
89+
if (jobPart.getBlob().getVersionId() != null) {
90+
getObjectRequest.withVersionId(jobPart.getBlob().getVersionId());
91+
}
9092

9193
final ImmutableCollection<Range> rangesForBlob = StrategyUtils.getRangesForBlob(rangesForBlobs, blob);
9294

0 commit comments

Comments
 (0)