diff options
author | Simon Rettberg | 2018-06-28 12:22:05 +0200 |
---|---|---|
committer | Simon Rettberg | 2018-06-28 12:22:05 +0200 |
commit | 4402df069e6e6c1849f6e6867c0aa65d912749cc (patch) | |
tree | f254cad516043d38f46eeae0802cc84ebc922414 /dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/fileserv/FileServer.java | |
parent | [client] image details: Move share/update button to overview tab (diff) | |
download | tutor-module-4402df069e6e6c1849f6e6867c0aa65d912749cc.tar.gz tutor-module-4402df069e6e6c1849f6e6867c0aa65d912749cc.tar.xz tutor-module-4402df069e6e6c1849f6e6867c0aa65d912749cc.zip |
[server] Fix issues FindBugs uncovered
Diffstat (limited to 'dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/fileserv/FileServer.java')
-rw-r--r-- | dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/fileserv/FileServer.java | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/fileserv/FileServer.java b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/fileserv/FileServer.java index a12d149c..656a515b 100644 --- a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/fileserv/FileServer.java +++ b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/fileserv/FileServer.java @@ -213,16 +213,18 @@ public class FileServer implements IncomingEvent { LOGGER.warn("Rejecting download of VID " + localImageData.imageVersionId + ": Invalid local relative path"); errorMessage = "File has invalid path on server"; - } else if (!srcFile.canRead()) { - LOGGER.warn("Rejecting download of VID " + localImageData.imageVersionId + ": Missing " - + srcFile.getPath()); - errorMessage = "File missing on server"; - } - if (srcFile.length() != localImageData.fileSize) { - LOGGER.warn("Rejecting download of VID " + localImageData.imageVersionId + ": Size mismatch for " - + srcFile.getPath() + " (expected " + localImageData.fileSize + ", is " - + srcFile.length() + ")"); - errorMessage = "File corrupted on server"; + } else { + if (!srcFile.canRead()) { + LOGGER.warn("Rejecting download of VID " + localImageData.imageVersionId + ": Missing " + + srcFile.getPath()); + errorMessage = "File missing on server"; + } + if (srcFile.length() != localImageData.fileSize) { + LOGGER.warn("Rejecting download of VID " + localImageData.imageVersionId + + ": Size mismatch for " + srcFile.getPath() + " (expected " + + localImageData.fileSize + ", is " + srcFile.length() + ")"); + errorMessage = "File corrupted on server"; + } } if (errorMessage != null) { if (localImageData.isValid) { |