Attempted to fix Metrics IO error
This commit is contained in:
parent
7e5b244585
commit
0e9df75f17
2 changed files with 5 additions and 5 deletions
|
@ -11,7 +11,7 @@ import alisolarflare.components.metrics.files.MetricsFile;
|
||||||
import alisolarflare.components.metrics.output.GetLoginMetrics;
|
import alisolarflare.components.metrics.output.GetLoginMetrics;
|
||||||
|
|
||||||
public class MetricsComponent extends Component{
|
public class MetricsComponent extends Component{
|
||||||
String defaultPath = "metrics";
|
String defaultPath = "AliPresents/metrics";
|
||||||
String defaultFilePath = (defaultPath + "/metrics.txt");
|
String defaultFilePath = (defaultPath + "/metrics.txt");
|
||||||
String playerLoginsFilePath = (defaultPath + "/playerLogins.txt");
|
String playerLoginsFilePath = (defaultPath + "/playerLogins.txt");
|
||||||
|
|
||||||
|
|
|
@ -13,17 +13,17 @@ import java.util.List;
|
||||||
import buttondevteam.lib.TBMCCoreAPI;
|
import buttondevteam.lib.TBMCCoreAPI;
|
||||||
|
|
||||||
public class MetricsFile {
|
public class MetricsFile {
|
||||||
private String fileName = "metrics/playerLogins.txt";
|
private String fileName = "AliPresents/metrics/playerLogins.txt";
|
||||||
public MetricsFile(String directory){
|
public MetricsFile(String directory){
|
||||||
this.fileName = directory;
|
this.fileName = directory;
|
||||||
}
|
}
|
||||||
public void AddLine(String string){
|
public void AddLine(String string){
|
||||||
BufferedWriter inputStream = null;
|
BufferedWriter inputStream = null;
|
||||||
try {
|
try {
|
||||||
File file = new File("metrics/playerLogins.txt");
|
File file = new File(fileName);
|
||||||
TBMCCoreAPI.sendDebugMessage("Metrics File Exists: " + file.exists());
|
TBMCCoreAPI.SendException("Metrics File Exists: " + file.exists(), new IOException());
|
||||||
inputStream = new BufferedWriter(new FileWriter(fileName, true));
|
inputStream = new BufferedWriter(new FileWriter(fileName, true));
|
||||||
TBMCCoreAPI.sendDebugMessage("Input Stream Created!");
|
TBMCCoreAPI.SendException("Input Stream Created!", new IOException());
|
||||||
inputStream.write(string);
|
inputStream.write(string);
|
||||||
inputStream.newLine();
|
inputStream.newLine();
|
||||||
inputStream.close();
|
inputStream.close();
|
||||||
|
|
Loading…
Reference in a new issue