{
+ private final ObjectCompletedListener objectCompletedListener;
+
+ public StringUpdateStrategy(final ObjectCompletedListener objectCompletedListener) {
+ this.objectCompletedListener = objectCompletedListener;
+ }
+
+ @Override
+ public void update(final String eventData) {
+ objectCompletedListener.objectCompleted(eventData);
+ }
+ }
}
diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/SingleThreadedTransferStrategy.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/SingleThreadedTransferStrategy.java
index 9f6456d32..11864ba8e 100644
--- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/SingleThreadedTransferStrategy.java
+++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/SingleThreadedTransferStrategy.java
@@ -15,7 +15,6 @@
package com.spectralogic.ds3client.helpers.strategy.transferstrategy;
-import com.google.common.util.concurrent.MoreExecutors;
import com.spectralogic.ds3client.Ds3Client;
import com.spectralogic.ds3client.helpers.JobState;
import com.spectralogic.ds3client.helpers.events.FailureEvent;
diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/TransferStrategyBuilder.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/TransferStrategyBuilder.java
index 855b9896d..26b2d8cc5 100644
--- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/TransferStrategyBuilder.java
+++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/TransferStrategyBuilder.java
@@ -149,7 +149,6 @@ public final class TransferStrategyBuilder {
* @return The instance of this builder, with the intent that you can string together the behaviors you wish,
* for example:
*
- * {@code
* final PutBulkJobSpectraS3Request request = new PutBulkJobSpectraS3Request(BUCKET_NAME, Lists.newArrayList(objectsToWrite));
* final PutBulkJobSpectraS3Response putBulkJobSpectraS3Response = client.putBulkJobSpectraS3(request);
*
@@ -163,9 +162,9 @@ public final class TransferStrategyBuilder {
* masterObjectList,
* eventDispatcher,
* new MaxChunkAttemptsRetryBehavior(5),
- * new ClientDefinedChunkAttemptRetryDelayBehavior(1, eventDispatcher),
+ * new ClientDefinedChunkAttemptRetryDelayBehavior(1, eventDispatcher,
* new Monitorable() {
- * @Override
+ * @Override
* public void monitor() {
* numChunkAllocationAttempts.incrementAndGet();
* }
@@ -227,8 +226,8 @@ public TransferStrategyBuilder withTransferRetryDecorator(final TransferRetryDec
/**
* The transfer function to use when putting an object to a Black Pearl when the value in
* {@link TransferStrategyBuilder#withChecksumType(ChecksumType.Type)} is not
- * {@link ChecksumType.None}. This builder will make a checksum function of the correct type
- * if you specify a checksum type other than {@link ChecksumType.None} but do not specify a
+ * {@link com.spectralogic.ds3client.models.ChecksumType.Type#NONE}. This builder will make a checksum function of the correct type
+ * if you specify a checksum type other than {@link com.spectralogic.ds3client.models.ChecksumType.Type#NONE} but do not specify a
* checksum function.
* @return The instance of this builder, with the intent that you can string together the behaviors you wish.
*/
@@ -238,7 +237,7 @@ public TransferStrategyBuilder withChecksumFunction(final ChecksumFunction check
}
/**
- * The {@link ChecksumType.None} you would like to compute and include in the payload sent to a
+ * The {@link com.spectralogic.ds3client.models.ChecksumType.Type#NONE} you would like to compute and include in the payload sent to a
* Black Pearl when putting an object.
* @return The instance of this builder, with the intent that you can string together the behaviors you wish.
*/
@@ -716,7 +715,7 @@ public void objectCompleted(final String name) {
return jobPartTracker;
}
- private ImmutableList getBlobs(final List chunks) {
+ private static ImmutableList getBlobs(final List chunks) {
final ImmutableList.Builder builder = ImmutableList.builder();
for (final Objects objects : chunks) {
builder.addAll(objects.getObjects());
@@ -725,7 +724,8 @@ private ImmutableList getBlobs(final List chunks) {
}
private void makeDefaultChecksumFunction() {
- final ChecksumFunction newChecksumFunction = new ChecksumFunction() {
+
+ checksumFunction = new ChecksumFunction() {
@Override
public String compute(final BulkObject obj, final ByteChannel channel) {
String checksum = null;
@@ -756,8 +756,6 @@ public String compute(final BulkObject obj, final ByteChannel channel) {
return checksum;
}
};
-
- checksumFunction = newChecksumFunction;
}
private TransferStrategy makeRandomAccessPutTransferStrategy() {
diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/WaitingForChunksObserver.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/WaitingForChunksObserver.java
index f350dfc1a..455bdd9cd 100644
--- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/WaitingForChunksObserver.java
+++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/WaitingForChunksObserver.java
@@ -25,12 +25,7 @@
*/
public class WaitingForChunksObserver extends AbstractObserver {
public WaitingForChunksObserver(final WaitingForChunksListener waitingForChunksListener) {
- super(new UpdateStrategy() {
- @Override
- public void update(final Integer eventData) {
- waitingForChunksListener.waiting(eventData);
- }
- });
+ super(new IntegerUpdateStrategy(waitingForChunksListener));
Preconditions.checkNotNull(waitingForChunksListener, "waitingForChunksListener may not be null.");
}
@@ -38,4 +33,17 @@ public void update(final Integer eventData) {
public WaitingForChunksObserver(final UpdateStrategy updateStrategy) {
super(updateStrategy);
}
+
+ private static class IntegerUpdateStrategy implements UpdateStrategy {
+ private final WaitingForChunksListener waitingForChunksListener;
+
+ public IntegerUpdateStrategy(final WaitingForChunksListener waitingForChunksListener) {
+ this.waitingForChunksListener = waitingForChunksListener;
+ }
+
+ @Override
+ public void update(final Integer eventData) {
+ waitingForChunksListener.waiting(eventData);
+ }
+ }
}
diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/BulkObject.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/BulkObject.java
index 6c6b0f5bc..8c05fefcb 100644
--- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/BulkObject.java
+++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/BulkObject.java
@@ -168,7 +168,7 @@ && nullableEquals(this.getName(), bulkObject.getName())
* Tests if two objects are equal, and handles the case if either or both objects are null
*/
protected static boolean nullableEquals(final Object obj1, final Object obj2) {
- return obj1 == null && obj2 == null || obj1 != null && obj2 != null && obj1.equals(obj2);
+ return obj1 == null && obj2 == null || obj1 != null && obj1.equals(obj2);
}
@Override
diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/CacheFilesystem.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/CacheFilesystem.java
index 6d6a80657..525c2f924 100644
--- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/CacheFilesystem.java
+++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/CacheFilesystem.java
@@ -45,6 +45,9 @@ public class CacheFilesystem {
@JsonProperty("MaxPercentUtilizationOfFilesystem")
private Double maxPercentUtilizationOfFilesystem;
+ @JsonProperty("NeedsReconcile")
+ private boolean needsReconcile;
+
@JsonProperty("NodeId")
private UUID nodeId;
@@ -121,6 +124,15 @@ public void setMaxPercentUtilizationOfFilesystem(final Double maxPercentUtilizat
}
+ public boolean getNeedsReconcile() {
+ return this.needsReconcile;
+ }
+
+ public void setNeedsReconcile(final boolean needsReconcile) {
+ this.needsReconcile = needsReconcile;
+ }
+
+
public UUID getNodeId() {
return this.nodeId;
}
diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/ChecksumType.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/ChecksumType.java
index e4e8e0e16..4e2ef702d 100644
--- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/ChecksumType.java
+++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/ChecksumType.java
@@ -18,6 +18,7 @@
import org.apache.commons.codec.binary.Base64;
import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
public abstract class ChecksumType {
@@ -85,7 +86,7 @@ public Value(final String hash) {
@Override
public T match(final MatchHandler handler) throws E {
- return handler.value(this.hash.getBytes(Charset.forName("UTF-8")));
+ return handler.value(this.hash.getBytes(StandardCharsets.UTF_8));
}
}
}
diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/JobCreationFailed.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/JobCreationFailed.java
new file mode 100644
index 000000000..1a98ea59a
--- /dev/null
+++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/JobCreationFailed.java
@@ -0,0 +1,106 @@
+/*
+ * ******************************************************************************
+ * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved.
+ * Licensed under the Apache License, Version 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file.
+ * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+ * CONDITIONS OF ANY KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ * ****************************************************************************
+ */
+
+// This code is auto-generated, do not modify
+package com.spectralogic.ds3client.models;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
+import java.util.Date;
+import java.util.UUID;
+
+@JacksonXmlRootElement(namespace = "Data")
+public class JobCreationFailed {
+
+ // Variables
+ @JsonProperty("Date")
+ private Date date;
+
+ @JsonProperty("ErrorMessage")
+ private String errorMessage;
+
+ @JsonProperty("Id")
+ private UUID id;
+
+ @JsonProperty("TapeBarCodes")
+ private String tapeBarCodes;
+
+ @JsonProperty("Type")
+ private JobCreationFailedType type;
+
+ @JsonProperty("UserName")
+ private String userName;
+
+ // Constructor
+ public JobCreationFailed() {
+ //pass
+ }
+
+ // Getters and Setters
+
+ public Date getDate() {
+ return this.date;
+ }
+
+ public void setDate(final Date date) {
+ this.date = date;
+ }
+
+
+ public String getErrorMessage() {
+ return this.errorMessage;
+ }
+
+ public void setErrorMessage(final String errorMessage) {
+ this.errorMessage = errorMessage;
+ }
+
+
+ public UUID getId() {
+ return this.id;
+ }
+
+ public void setId(final UUID id) {
+ this.id = id;
+ }
+
+
+ public String getTapeBarCodes() {
+ return this.tapeBarCodes;
+ }
+
+ public void setTapeBarCodes(final String tapeBarCodes) {
+ this.tapeBarCodes = tapeBarCodes;
+ }
+
+
+ public JobCreationFailedType getType() {
+ return this.type;
+ }
+
+ public void setType(final JobCreationFailedType type) {
+ this.type = type;
+ }
+
+
+ public String getUserName() {
+ return this.userName;
+ }
+
+ public void setUserName(final String userName) {
+ this.userName = userName;
+ }
+
+}
\ No newline at end of file
diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/JobCreationFailedList.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/JobCreationFailedList.java
new file mode 100644
index 000000000..36e50009e
--- /dev/null
+++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/JobCreationFailedList.java
@@ -0,0 +1,48 @@
+/*
+ * ******************************************************************************
+ * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved.
+ * Licensed under the Apache License, Version 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file.
+ * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+ * CONDITIONS OF ANY KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ * ****************************************************************************
+ */
+
+// This code is auto-generated, do not modify
+package com.spectralogic.ds3client.models;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
+import java.util.List;
+import java.util.ArrayList;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
+
+@JacksonXmlRootElement(namespace = "Data")
+public class JobCreationFailedList {
+
+ // Variables
+ @JsonProperty("JobCreationFailed")
+ @JacksonXmlElementWrapper(useWrapping = false)
+ private List jobCreationFaileds = new ArrayList<>();
+
+ // Constructor
+ public JobCreationFailedList() {
+ //pass
+ }
+
+ // Getters and Setters
+
+ public List getJobCreationFaileds() {
+ return this.jobCreationFaileds;
+ }
+
+ public void setJobCreationFaileds(final List jobCreationFaileds) {
+ this.jobCreationFaileds = jobCreationFaileds;
+ }
+
+}
\ No newline at end of file
diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/JobCreationFailedType.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/JobCreationFailedType.java
new file mode 100644
index 000000000..5f0d8881d
--- /dev/null
+++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/JobCreationFailedType.java
@@ -0,0 +1,21 @@
+/*
+ * ******************************************************************************
+ * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved.
+ * Licensed under the Apache License, Version 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file.
+ * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+ * CONDITIONS OF ANY KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ * ****************************************************************************
+ */
+
+// This code is auto-generated, do not modify
+package com.spectralogic.ds3client.models;
+
+public enum JobCreationFailedType {
+ TAPES_MUST_BE_ONLINED
+}
\ No newline at end of file
diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapeDriveType.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapeDriveType.java
index 8f4f01a48..816b51049 100644
--- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapeDriveType.java
+++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapeDriveType.java
@@ -26,5 +26,6 @@ public enum TapeDriveType {
TS1140,
TS1150,
TS1155,
- TS1160
+ TS1160,
+ TS1170
}
\ No newline at end of file
diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/bulk/Ds3ObjectList.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/bulk/Ds3ObjectList.java
index c6e941359..ccb58ad6f 100644
--- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/bulk/Ds3ObjectList.java
+++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/bulk/Ds3ObjectList.java
@@ -16,11 +16,7 @@
package com.spectralogic.ds3client.models.bulk;
import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
-import com.spectralogic.ds3client.models.Priority;
-import com.spectralogic.ds3client.models.JobChunkClientProcessingOrderGuarantee;
-import com.spectralogic.ds3client.models.WriteOptimization;
import com.spectralogic.ds3client.utils.collections.StreamWrapper;
import java.util.stream.Stream;
diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/bulk/PartialDs3Object.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/bulk/PartialDs3Object.java
index 7d3210703..077aaeb40 100644
--- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/bulk/PartialDs3Object.java
+++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/bulk/PartialDs3Object.java
@@ -53,9 +53,7 @@ public int hashCode() {
public boolean equals(final Object obj) {
if (obj instanceof PartialDs3Object) {
final PartialDs3Object partialDs3Object = (PartialDs3Object) obj;
- if (super.equals(obj) && this.getRange().equals(partialDs3Object.getRange())) {
- return true;
- }
+ return super.equals(obj) && this.getRange().equals(partialDs3Object.getRange());
}
return false;
}
diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/common/Range.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/common/Range.java
index 34f9d6db3..604c78647 100644
--- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/common/Range.java
+++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/common/Range.java
@@ -65,9 +65,7 @@ public int hashCode() {
public boolean equals(final Object obj) {
if (obj instanceof Range) {
final Range range = (Range) obj;
- if (range.start == this.start && range.end == this.end) {
- return true;
- }
+ return range.start == this.start && range.end == this.end;
}
return false;
}
diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/networking/HashGeneratingMatchHandler.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/networking/HashGeneratingMatchHandler.java
index e5f0f7e8d..fdc5fcc9c 100644
--- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/networking/HashGeneratingMatchHandler.java
+++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/networking/HashGeneratingMatchHandler.java
@@ -21,6 +21,7 @@
import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
class HashGeneratingMatchHandler implements ChecksumType.MatchHandler {
private static final int READ_BUFFER_SIZE = 1024;
@@ -51,7 +52,7 @@ public String compute() throws IOException {
@Override
public String value(final byte[] hash) throws IOException {
- return new String(hash, Charset.forName("UTF-8"));
+ return new String(hash, StandardCharsets.UTF_8);
}
private String hashInputStream(final Hasher digest, final InputStream stream) throws IOException {
@@ -71,14 +72,14 @@ private String hashInputStream(final Hasher digest, final InputStream stream) th
return digest.digest();
}
- private Hasher getHasher(final ChecksumType.Type checksumType) {
+ private static Hasher getHasher(final ChecksumType.Type checksumType) {
switch (checksumType) {
case MD5: return new MD5Hasher();
case SHA_256: return new SHA256Hasher();
case SHA_512: return new SHA512Hasher();
case CRC_32: return new CRC32Hasher();
case CRC_32C: return new CRC32CHasher();
- default: throw new RuntimeException("Unknown checksum type " + checksumType.toString());
+ default: throw new RuntimeException("Unknown checksum type " + checksumType);
}
}
}
diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/serializer/XmlOutput.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/serializer/XmlOutput.java
index 94c22ef3b..5c94d8af4 100644
--- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/serializer/XmlOutput.java
+++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/serializer/XmlOutput.java
@@ -28,7 +28,6 @@
import java.io.IOException;
import java.io.InputStream;
-import java.util.Properties;
public final class XmlOutput {
private static final JacksonXmlModule module;
diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/ByteArraySeekableByteChannel.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/ByteArraySeekableByteChannel.java
index c1f401be9..5be828ca6 100644
--- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/ByteArraySeekableByteChannel.java
+++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/ByteArraySeekableByteChannel.java
@@ -19,6 +19,7 @@
import java.nio.ByteBuffer;
import java.nio.channels.SeekableByteChannel;
import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
import java.util.Arrays;
public class ByteArraySeekableByteChannel implements SeekableByteChannel {
@@ -101,7 +102,7 @@ public byte[] toByteArray() {
@Override
public String toString() {
- return this.toString(Charset.forName("UTF-8"));
+ return this.toString(StandardCharsets.UTF_8);
}
public String toString(final Charset charset) {
diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/JobUtils.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/JobUtils.java
index e949f11fd..952078465 100644
--- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/JobUtils.java
+++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/JobUtils.java
@@ -34,8 +34,8 @@ public final class JobUtils {
private JobUtils() {}
/**
- * Finds all the jobs that have any of the files in {@param fileNames} contained in them. When {@param type} is PUT
- * only one job ID should be returned. It is possible that when {@param type} is GET that there could be multiple
+ * Finds all the jobs that have any of the files in {@code fileNames} contained in them. When {@code type} is PUT
+ * only one job ID should be returned. It is possible that when {@code type} is GET that there could be multiple
* job IDs returned.
*/
public static List findJob(final Ds3Client client, final JobRequestType type, final String bucketName, final Set fileNames) throws IOException {
diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/Signature.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/Signature.java
index 1d188b331..dca03d41b 100644
--- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/Signature.java
+++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/Signature.java
@@ -24,6 +24,7 @@
import org.slf4j.LoggerFactory;
import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
import java.security.SignatureException;
import java.util.Collection;
import java.util.Map;
@@ -53,14 +54,14 @@ public static String calculateRFC2104HMAC(final String data, final String key)
final String result;
try {
// get an hmac_sha1 key from the raw key bytes
- final SecretKeySpec signingKey = new SecretKeySpec(key.getBytes(Charset.forName("UTF-8")), HMAC_SHA1_ALGORITHM);
+ final SecretKeySpec signingKey = new SecretKeySpec(key.getBytes(StandardCharsets.UTF_8), HMAC_SHA1_ALGORITHM);
// get an hmac_sha1 Mac instance and initialize with the signing key
final Mac mac = Mac.getInstance(HMAC_SHA1_ALGORITHM);
mac.init(signingKey);
// compute the hmac on input data bytes
- final byte[] rawHmac = mac.doFinal(data.getBytes(Charset.forName("UTF-8")));
+ final byte[] rawHmac = mac.doFinal(data.getBytes(StandardCharsets.UTF_8));
result = Base64.encodeBase64String(rawHmac);
} catch (final Exception e) {
throw new SignatureException("Failed to generate HMAC: " + e.getMessage(), e);
diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/collections/LazyIterable.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/collections/LazyIterable.java
index 6da79bb4e..8e9c664b7 100644
--- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/collections/LazyIterable.java
+++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/collections/LazyIterable.java
@@ -59,7 +59,7 @@ public interface LazyLoader {
Iterable getNextValues();
}
- private class LazyObjectIterator implements Iterator {
+ private static class LazyObjectIterator implements Iterator {
private final LazyLoader iterableLoader;
diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/hashing/ChecksumHasher.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/hashing/ChecksumHasher.java
index dd4189b18..1e3cf7e91 100644
--- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/hashing/ChecksumHasher.java
+++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/hashing/ChecksumHasher.java
@@ -44,7 +44,7 @@ public String digest() {
return Base64.encodeBase64String(toBytes(checksum.getValue()));
}
- private byte[] toBytes(final long x) {
+ private static byte[] toBytes(final long x) {
final ByteBuffer buffer = ByteBuffer.allocate(8);
buffer.order(ByteOrder.BIG_ENDIAN);
buffer.putLong(x);
diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/hashing/ChecksumUtils.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/hashing/ChecksumUtils.java
index 6a6523b3b..1779b7161 100644
--- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/hashing/ChecksumUtils.java
+++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/hashing/ChecksumUtils.java
@@ -38,7 +38,7 @@ public static Hasher getHasher(final ChecksumType.Type checksumType) {
case CRC_32C:
return new CRC32CHasher();
default:
- throw new RuntimeException("Unknown checksum type " + checksumType.toString());
+ throw new RuntimeException("Unknown checksum type " + checksumType);
}
}
diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/hashing/Crc32c.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/hashing/Crc32c.java
index ff2b293ad..5501cbf12 100644
--- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/hashing/Crc32c.java
+++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/hashing/Crc32c.java
@@ -158,7 +158,7 @@ public void reset() {
crc = 0;
}
- private long updateByte(final byte newByte, final long crc) {
+ private static long updateByte(final byte newByte, final long crc) {
final byte b = (byte) (newByte & BYTE_MASK);
final int index = (int) ((crc ^ b) & BYTE_MASK);
return (CRC_TABLE[index] ^ (crc >> 8)) & LONG_MASK;
diff --git a/ds3-sdk/src/test/java/com/spectralogic/ds3client/Ds3Client_Test.java b/ds3-sdk/src/test/java/com/spectralogic/ds3client/Ds3Client_Test.java
index b03382fe4..0ad2f9dc3 100644
--- a/ds3-sdk/src/test/java/com/spectralogic/ds3client/Ds3Client_Test.java
+++ b/ds3-sdk/src/test/java/com/spectralogic/ds3client/Ds3Client_Test.java
@@ -41,6 +41,7 @@
import java.net.URISyntaxException;
import java.nio.channels.FileChannel;
import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.StandardOpenOption;
@@ -100,7 +101,7 @@ public void setTimeZone() {
public void getBuckets() throws IOException, ParseException {
final UUID id = UUID.randomUUID();
final String stringResponse = "\n" +
- "" + id.toString() + "ryantestBucket22013-12-11T23:20:09bulkTest2013-12-11T23:20:09bulkTest12013-12-11T23:20:09bulkTest22013-12-11T23:20:09bulkTest32013-12-11T23:20:09bulkTest42013-12-11T23:20:09bulkTest52013-12-11T23:20:09bulkTest62013-12-11T23:20:09testBucket32013-12-11T23:20:09testBucket12013-12-11T23:20:09testbucket2013-12-11T23:20:09";
+ "" + id + "ryantestBucket22013-12-11T23:20:09bulkTest2013-12-11T23:20:09bulkTest12013-12-11T23:20:09bulkTest22013-12-11T23:20:09bulkTest32013-12-11T23:20:09bulkTest42013-12-11T23:20:09bulkTest52013-12-11T23:20:09bulkTest62013-12-11T23:20:09testBucket32013-12-11T23:20:09testBucket12013-12-11T23:20:09testbucket2013-12-11T23:20:09";
final List expectedBucketNames = Arrays.asList(
"testBucket2",
@@ -158,9 +159,9 @@ public void getBadBuckets() throws IOException {
public void getBucket() throws IOException, ParseException {
final UUID id = UUID.randomUUID();
final String xmlResponse = "remoteTest161000falseuser/hduser/gutenberg/20417.txt.utf-82014-01-03T13:26:47.000Z8B19F3F41868106382A677C3435BDCE5674570STANDARD" +
- "" + id.toString() + "ryanuser/hduser/gutenberg/5000.txt.utf-82014-01-03T13:26:47.000Z9DE344878423E44B129730CE22B4B1371423803STANDARD" +
- "" + id.toString() + "ryanuser/hduser/gutenberg/4300.txt.utf-82014-01-03T13:26:47.000Z33EE4519EA7DDAB27CA4E2742326D70B1573150DEEP" +
- "" + id.toString() + "ryan";
+ "" + id + "ryan