Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/test/java/com/overstock/sample/processor/Compiler.java
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,15 @@ private static String buildClassPath(File outputDir) {
}

private static String classPathFor(Class<?> clazz) {
return clazz.getProtectionDomain().getCodeSource().getLocation().getFile();
URL url = clazz.getProtectionDomain().getCodeSource().getLocation();

try {
URI uri = url.toURI();

return Paths.get(uri).toFile().getAbsolutePath();
} catch (URISyntaxException e) {
throw new RuntimeException(e);
}
}

protected File writeSourceFile(SourceFile sourceFile) throws IOException {
Expand Down