kopia lustrzana https://github.com/gaul/s3proxy
Update java.version to 1.8
This was implied by the jclouds 2.3.0 upgrade. Also address modernizer warnings.pull/358/head^2
rodzic
2812fc4482
commit
b625476493
2
pom.xml
2
pom.xml
|
@ -307,7 +307,7 @@
|
|||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<java.version>1.7</java.version>
|
||||
<java.version>1.8</java.version>
|
||||
<jclouds.version>2.3.0</jclouds.version>
|
||||
<slf4j.version>1.7.28</slf4j.version>
|
||||
<shade.prefix>${project.groupId}.shaded</shade.prefix>
|
||||
|
|
|
@ -23,6 +23,7 @@ import java.security.InvalidKeyException;
|
|||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Base64;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
@ -174,7 +175,7 @@ final class AwsSignature {
|
|||
} catch (InvalidKeyException | NoSuchAlgorithmException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
return BaseEncoding.base64().encode(mac.doFinal(
|
||||
return Base64.getEncoder().encodeToString(mac.doFinal(
|
||||
stringToSign.getBytes(StandardCharsets.UTF_8)));
|
||||
}
|
||||
|
||||
|
|
|
@ -34,12 +34,14 @@ import java.security.NoSuchAlgorithmException;
|
|||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Base64;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
import java.util.SortedMap;
|
||||
import java.util.TimeZone;
|
||||
|
@ -60,7 +62,6 @@ import javax.xml.stream.XMLStreamWriter;
|
|||
import com.fasterxml.jackson.core.JsonParseException;
|
||||
import com.fasterxml.jackson.dataformat.xml.XmlMapper;
|
||||
import com.google.common.base.CharMatcher;
|
||||
import com.google.common.base.Optional;
|
||||
import com.google.common.base.Splitter;
|
||||
import com.google.common.base.Strings;
|
||||
import com.google.common.cache.Cache;
|
||||
|
@ -254,7 +255,7 @@ public class S3ProxyHandler {
|
|||
};
|
||||
}
|
||||
this.authenticationType = authenticationType;
|
||||
this.virtualHost = Optional.fromNullable(virtualHost);
|
||||
this.virtualHost = Optional.ofNullable(virtualHost);
|
||||
this.maxSinglePartObjectSize = maxSinglePartObjectSize;
|
||||
this.v4MaxNonChunkedRequestSize = v4MaxNonChunkedRequestSize;
|
||||
this.ignoreUnknownHeaders = ignoreUnknownHeaders;
|
||||
|
@ -1894,7 +1895,7 @@ public class S3ProxyHandler {
|
|||
if (contentMD5String != null) {
|
||||
try {
|
||||
contentMD5 = HashCode.fromBytes(
|
||||
BaseEncoding.base64().decode(contentMD5String));
|
||||
Base64.getDecoder().decode(contentMD5String));
|
||||
} catch (IllegalArgumentException iae) {
|
||||
throw new S3Exception(S3ErrorCode.INVALID_DIGEST, iae);
|
||||
}
|
||||
|
@ -2107,7 +2108,7 @@ public class S3ProxyHandler {
|
|||
return;
|
||||
}
|
||||
} else {
|
||||
String expectedSignature = BaseEncoding.base64().encode(
|
||||
String expectedSignature = Base64.getEncoder().encodeToString(
|
||||
hmac("HmacSHA1", policy,
|
||||
credential.getBytes(StandardCharsets.UTF_8)));
|
||||
if (!constantTimeEquals(signature, expectedSignature)) {
|
||||
|
@ -2702,7 +2703,7 @@ public class S3ProxyHandler {
|
|||
if (contentMD5String != null) {
|
||||
try {
|
||||
contentMD5 = HashCode.fromBytes(
|
||||
BaseEncoding.base64().decode(contentMD5String));
|
||||
Base64.getDecoder().decode(contentMD5String));
|
||||
} catch (IllegalArgumentException iae) {
|
||||
throw new S3Exception(S3ErrorCode.INVALID_DIGEST, iae);
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue