From 95ef974200d9c6229e66c945e94a9fb96a348757 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Fri, 13 Sep 2019 10:27:42 +0200 Subject: [server] Fix: Don't use deprecated methods from FileUtils --- .../src/main/java/org/openslx/bwlp/sat/StorageUseCheck.java | 7 ++++--- 1 file 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); -- cgit v1.2.3-55-g7522