summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2019-09-13 10:27:42 +0200
committerSimon Rettberg2019-09-13 10:27:42 +0200
commit95ef974200d9c6229e66c945e94a9fb96a348757 (patch)
treece2fc3698fd86e33594eee963c50dc7664f6dbba
parentImplement CONFIG_USB feature (diff)
downloadtutor-module-95ef974200d9c6229e66c945e94a9fb96a348757.tar.gz
tutor-module-95ef974200d9c6229e66c945e94a9fb96a348757.tar.xz
tutor-module-95ef974200d9c6229e66c945e94a9fb96a348757.zip
[server] Fix: Don't use deprecated methods from FileUtils
-rw-r--r--dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/StorageUseCheck.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/StorageUseCheck.java b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/StorageUseCheck.java
index a91e6535..2a5f1b1a 100644
--- a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/StorageUseCheck.java
+++ b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/StorageUseCheck.java
@@ -2,6 +2,7 @@ package org.openslx.bwlp.sat;
import java.io.File;
import java.io.IOException;
+import java.nio.charset.StandardCharsets;
import java.util.UUID;
import org.apache.commons.io.FileUtils;
@@ -39,7 +40,7 @@ public class StorageUseCheck extends Task {
}
if (!created || !canary.exists()) {
try {
- FileUtils.write(canary, uuid);
+ FileUtils.write(canary, uuid, StandardCharsets.UTF_8);
} catch (IOException e) {
LOGGER.fatal("Cannot write lock file to VMStore", e);
System.exit(1);
@@ -48,7 +49,7 @@ public class StorageUseCheck extends Task {
} else {
String canaryContents;
try {
- canaryContents = FileUtils.readFileToString(canary);
+ canaryContents = FileUtils.readFileToString(canary, StandardCharsets.UTF_8);
} catch (IOException e) {
LOGGER.warn("Lock file cannot be accessed. Cannot ensure exclusive use of VMStore", e);
return;
@@ -57,7 +58,7 @@ public class StorageUseCheck extends Task {
LOGGER.fatal("Lock file content changed. Another server instance is using the VMStore."
+ " Will exit immediately to prevent any damages.");
try {
- FileUtils.write(canary, uuid);
+ FileUtils.write(canary, uuid, StandardCharsets.UTF_8);
} catch (IOException e) {
}
System.exit(1);