From 0e9df75f17fbc33794e6171d09c0190aeaf55a4d Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sat, 26 Nov 2016 19:45:10 -0500 Subject: [PATCH] Attempted to fix Metrics IO error --- .../components/metrics/MetricsComponent.java | 2 +- .../components/metrics/files/MetricsFile.java | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/alisolarflare/components/metrics/MetricsComponent.java b/src/alisolarflare/components/metrics/MetricsComponent.java index 3bb855f..a01c0a8 100644 --- a/src/alisolarflare/components/metrics/MetricsComponent.java +++ b/src/alisolarflare/components/metrics/MetricsComponent.java @@ -11,7 +11,7 @@ import alisolarflare.components.metrics.files.MetricsFile; import alisolarflare.components.metrics.output.GetLoginMetrics; public class MetricsComponent extends Component{ - String defaultPath = "metrics"; + String defaultPath = "AliPresents/metrics"; String defaultFilePath = (defaultPath + "/metrics.txt"); String playerLoginsFilePath = (defaultPath + "/playerLogins.txt"); diff --git a/src/alisolarflare/components/metrics/files/MetricsFile.java b/src/alisolarflare/components/metrics/files/MetricsFile.java index cbff71a..2420cd7 100644 --- a/src/alisolarflare/components/metrics/files/MetricsFile.java +++ b/src/alisolarflare/components/metrics/files/MetricsFile.java @@ -13,17 +13,17 @@ import java.util.List; import buttondevteam.lib.TBMCCoreAPI; public class MetricsFile { - private String fileName = "metrics/playerLogins.txt"; + private String fileName = "AliPresents/metrics/playerLogins.txt"; public MetricsFile(String directory){ this.fileName = directory; } public void AddLine(String string){ BufferedWriter inputStream = null; try { - File file = new File("metrics/playerLogins.txt"); - TBMCCoreAPI.sendDebugMessage("Metrics File Exists: " + file.exists()); + File file = new File(fileName); + TBMCCoreAPI.SendException("Metrics File Exists: " + file.exists(), new IOException()); inputStream = new BufferedWriter(new FileWriter(fileName, true)); - TBMCCoreAPI.sendDebugMessage("Input Stream Created!"); + TBMCCoreAPI.SendException("Input Stream Created!", new IOException()); inputStream.write(string); inputStream.newLine(); inputStream.close();