From d3bd491f1d968c219c8dc81d4a038197ef6c8398 Mon Sep 17 00:00:00 2001 From: Jan Philipp Timme Date: Sun, 2 Nov 2014 01:21:05 +0100 Subject: [PATCH] Bugfix: Ersetzen des "/" durch eine entsprechende Konstante. Jetzt sollte es aber wirklich hinhauen. ._. --- .../spacescooter/utility/CodeEnvironment.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/de/teamteamteam/spacescooter/utility/CodeEnvironment.java b/src/de/teamteamteam/spacescooter/utility/CodeEnvironment.java index d03effb..3ae9f9c 100644 --- a/src/de/teamteamteam/spacescooter/utility/CodeEnvironment.java +++ b/src/de/teamteamteam/spacescooter/utility/CodeEnvironment.java @@ -42,17 +42,13 @@ public class CodeEnvironment { */ private static String[] getFileListFromFolder(File folder) { ArrayList fileList = new ArrayList(); - String rootPath = folder.getAbsolutePath() + "/"; + String rootPath = folder.getAbsolutePath() + File.separator; File[] folderContents = folder.listFiles(); for(File f : folderContents) { if(f.isDirectory()) { String[] filesInDirectory = CodeEnvironment.getFileListFromFolder(f); for(String entry : filesInDirectory) { - if(entry.contains(rootPath)) { - fileList.add(entry.substring(rootPath.length())); - } else { - fileList.add(entry); - } + fileList.add(entry.replace(rootPath, "")); } } else { fileList.add(f.toString());