diff --git a/pom.xml b/pom.xml
index 95eaeb5..c8532a9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -5,13 +5,14 @@
download-server
0.0.1-SNAPSHOT
+ 25
UTF-8
- 4.1.1.RELEASE
+ 5.0.6
org.springframework.boot
spring-boot-starter-parent
- 1.2.3.RELEASE
+ 3.2.12
@@ -19,138 +20,86 @@
org.apache.maven.plugins
maven-compiler-plugin
- 3.0
+ 3.15.0
- 1.8
- 1.8
+ ${java.version}
+
+ org.codehaus.gmavenplus
+ gmavenplus-plugin
+ 4.3.1
+
+ 25
+
+
+
+
+ addTestSources
+ compileTests
+
+
+
+
-
-
- io.spring.repo.maven.milestone
- http://repo.spring.io/milestone/
- false
-
-
-
- org.springframework
- spring-test
- 4.1.6.RELEASE
- test
-
org.spockframework
spock-spring
- 1.0-groovy-2.4
-
-
- org.codehaus.groovy
- groovy-all
-
-
+ 2.4-groovy-5.0
test
commons-io
commons-io
- 2.4
+ 2.17.0
commons-codec
commons-codec
- 1.10
+ 1.17.2
org.springframework.boot
spring-boot-starter-web
- 1.2.3.RELEASE
org.springframework.boot
spring-boot-starter-actuator
- 1.2.3.RELEASE
org.springframework.boot
spring-boot-starter-test
- 1.2.3.RELEASE
-
-
- org.springframework
- spring-test
-
-
test
org.spockframework
spock-core
- 1.0-groovy-2.4
+ 2.4-groovy-5.0
test
com.google.guava
guava
- 18.0
+ 33.4.0-jre
cglib
cglib-nodep
- 3.1
-
-
- org.springframework
- spring-beans
- 4.1.6.RELEASE
-
-
- org.springframework
- spring-context
- 4.1.6.RELEASE
+ 3.3.0
- org.springframework
- spring-context-support
- 4.1.6.RELEASE
-
-
- org.springframework
- spring-webmvc
- 4.1.6.RELEASE
-
-
- org.springframework
- spring-web
- 4.1.6.RELEASE
-
-
- org.springframework
- spring-aop
- 4.1.6.RELEASE
-
-
- org.springframework
- spring-core
- 4.1.6.RELEASE
-
-
- org.springframework
- spring-expression
- 4.1.6.RELEASE
-
-
- org.springframework
- spring-test
- 4.1.6.RELEASE
- test
-
-
- org.codehaus.groovy
+ org.apache.groovy
groovy-all
- 2.4.3
+ 5.0.6
+ pom
+
+
+ junit
+ junit
+
+
diff --git a/src/main/java/com/nurkiewicz/download/DownloadController.java b/src/main/java/com/nurkiewicz/download/DownloadController.java
index e717026..7969b3b 100644
--- a/src/main/java/com/nurkiewicz/download/DownloadController.java
+++ b/src/main/java/com/nurkiewicz/download/DownloadController.java
@@ -1,6 +1,5 @@
package com.nurkiewicz.download;
-import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.Resource;
import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;
@@ -25,7 +24,6 @@ public class DownloadController {
private final FileStorage storage;
- @Autowired
public DownloadController(FileStorage storage) {
this.storage = storage;
}
diff --git a/src/main/java/com/nurkiewicz/download/FileSystemPointer.java b/src/main/java/com/nurkiewicz/download/FileSystemPointer.java
index 5b9dbc0..bf73a0a 100644
--- a/src/main/java/com/nurkiewicz/download/FileSystemPointer.java
+++ b/src/main/java/com/nurkiewicz/download/FileSystemPointer.java
@@ -19,7 +19,7 @@ public class FileSystemPointer implements FilePointer {
public FileSystemPointer(File target) {
try {
this.target = target;
- this.tag = Files.hash(target, Hashing.sha512());
+ this.tag = Files.asByteSource(target).hash(Hashing.sha512());
final String contentType = java.nio.file.Files.probeContentType(target.toPath());
this.mediaTypeOrNull = contentType != null ?
MediaType.parse(contentType) :
diff --git a/src/main/java/com/nurkiewicz/download/MainApplication.java b/src/main/java/com/nurkiewicz/download/MainApplication.java
index 3bccd44..fe10ce1 100644
--- a/src/main/java/com/nurkiewicz/download/MainApplication.java
+++ b/src/main/java/com/nurkiewicz/download/MainApplication.java
@@ -7,7 +7,7 @@
class MainApplication {
public static void main(String[] args) {
- Integer temp = new Integer("1234");
+ Integer temp = Integer.valueOf("1234");
SpringApplication.run(MainApplication.class, args);
}
}
diff --git a/src/test/java/org/springframework/web/filter/Sha512ShallowEtagHeaderFilter.java b/src/test/java/org/springframework/web/filter/Sha512ShallowEtagHeaderFilter.java
index 50b2c90..bb4d79d 100644
--- a/src/test/java/org/springframework/web/filter/Sha512ShallowEtagHeaderFilter.java
+++ b/src/test/java/org/springframework/web/filter/Sha512ShallowEtagHeaderFilter.java
@@ -3,10 +3,14 @@
import com.google.common.hash.HashCode;
import com.google.common.hash.Hashing;
+import java.io.IOException;
+import java.io.InputStream;
+
public class Sha512ShallowEtagHeaderFilter extends ShallowEtagHeaderFilter {
@Override
- protected String generateETagHeaderValue(byte[] bytes) {
+ protected String generateETagHeaderValue(InputStream inputStream, boolean isWeak) throws IOException {
+ final byte[] bytes = inputStream.readAllBytes();
final HashCode hash = Hashing.sha512().hashBytes(bytes);
return "\"" + hash + "\"";
}