From 68597da9580255c2effb79157c67dd260cdddc15 Mon Sep 17 00:00:00 2001 From: DoggyCode Date: Wed, 26 Apr 2017 16:56:17 +0200 Subject: [PATCH] Removed duplicate/unnececary code in DiscUtil. --- .../com/massivecraft/factions/zcore/util/DiscUtil.java | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/massivecraft/factions/zcore/util/DiscUtil.java b/src/main/java/com/massivecraft/factions/zcore/util/DiscUtil.java index fb27d6ec..a4c44e7d 100644 --- a/src/main/java/com/massivecraft/factions/zcore/util/DiscUtil.java +++ b/src/main/java/com/massivecraft/factions/zcore/util/DiscUtil.java @@ -59,7 +59,6 @@ public class DiscUtil { private static HashMap locks = new HashMap(); public static boolean writeCatch(final File file, final String content, boolean sync) { - final byte[] bytes = utf8(content); String name = file.getName(); final Lock lock; @@ -75,9 +74,7 @@ public class DiscUtil { if (sync) { lock.lock(); try { - FileOutputStream out = new FileOutputStream(file); - out.write(bytes); - out.close(); + write(file, content); } catch (IOException e) { e.printStackTrace(); } finally { @@ -89,9 +86,7 @@ public class DiscUtil { public void run() { lock.lock(); try { - FileOutputStream out = new FileOutputStream(file); - out.write(bytes); - out.close(); + write(file, content); } catch (IOException e) { e.printStackTrace(); } finally {