Skip to content

Commit 55e2e7d

Browse files
committed
Merge github.com:matyb/java-koans
2 parents 83c81c9 + 991b2e2 commit 55e2e7d

2 files changed

Lines changed: 8 additions & 15 deletions

File tree

‎koans-lib/src/com/sandwich/util/io/directories/DirectorySet.java‎

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
package com.sandwich.util.io.directories;
22

33
import java.io.File;
4-
import java.net.URISyntaxException;
5-
import java.net.URL;
64

75
abstract class DirectorySet {
86

@@ -41,18 +39,13 @@ public String getDataDir(){
4139
}
4240

4341
private static String createBaseDir() {
44-
try {
45-
URL path = DirectorySet.class.getClassLoader().getResource(".");
46-
File dir = new File(path.toURI());
47-
if (dir.exists()) {
48-
dir = dir.getParentFile();
49-
if (dir.exists()) {
50-
dir = dir.getParentFile();
51-
}
52-
}
53-
return dir.getAbsolutePath();
54-
} catch (URISyntaxException e) {
55-
throw new RuntimeException(e);
56-
}
42+
File dir = new File(Thread.currentThread().getContextClassLoader().getResource(".").getFile().replace("%20", " "));
43+
if (dir.exists()) {
44+
dir = dir.getParentFile();
45+
if (dir.exists()) {
46+
dir = dir.getParentFile();
47+
}
48+
}
49+
return dir.getAbsolutePath();
5750
}
5851
}

‎koans/lib/koans.jar‎

-37 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)