diff options
Diffstat (limited to 'dozentenmodulserver/src')
-rw-r--r-- | dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/StorageUseCheck.java | 7 |
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); |