From c0d62228a01be1a8c3809a8af8c5c8d8a8a850e0 Mon Sep 17 00:00:00 2001 From: Max Lee Date: Thu, 15 Jan 2015 01:50:02 +0100 Subject: [PATCH] Made it more cross-platform compatible --- .../themoep/bukkit/plugin/RandomTeleport/RandomTeleport.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RandomTeleport v1.0/src/de/themoep/bukkit/plugin/RandomTeleport/RandomTeleport.java b/RandomTeleport v1.0/src/de/themoep/bukkit/plugin/RandomTeleport/RandomTeleport.java index a12a355..22f6398 100644 --- a/RandomTeleport v1.0/src/de/themoep/bukkit/plugin/RandomTeleport/RandomTeleport.java +++ b/RandomTeleport v1.0/src/de/themoep/bukkit/plugin/RandomTeleport/RandomTeleport.java @@ -541,7 +541,7 @@ public class RandomTeleport extends JavaPlugin implements CommandExecutor { public void writeMap(Object object, String outputFile) { try { - File file = new File(getDataFolder().getPath() + "/" + outputFile); + File file = new File(getDataFolder(), outputFile); if (!file.isFile()) { if(!file.createNewFile()){ throw new IOException("Error creating new file: " + file.getPath()); @@ -567,7 +567,7 @@ public class RandomTeleport extends JavaPlugin implements CommandExecutor { @SuppressWarnings("unchecked") public Object readMap(String inputFile) { HashMap map = new HashMap(); - File file = new File(getDataFolder().getPath() + "/" + inputFile); + File file = new File(getDataFolder(), inputFile); if (!file.isFile()) { getLogger().log(Level.INFO, "No file found in " + file.getPath()); try {