do not convert spaces for local paths

This commit is contained in:
Eugene Zhuravlev
2012-02-01 21:16:49 +01:00
parent 5eb09ef3fa
commit 208d4e5f74
2 changed files with 7 additions and 3 deletions
@@ -38,6 +38,10 @@ public class Paths {
}
public static URI toURI(String localPath) {
return toURI(localPath, true);
}
private static URI toURI(String localPath, boolean convertSpaces) {
try {
String p = FileUtil.toSystemIndependentName(localPath);
if (!p.startsWith("/")) {
@@ -46,7 +50,7 @@ public class Paths {
if (p.startsWith("//")) {
p = "//" + p;
}
return new URI("file", null, p.replaceAll(" ", "%20"), null);
return new URI("file", null, convertSpaces? p.replaceAll(" ", "%20") : p, null);
}
catch (URISyntaxException e) {
throw new Error(e);
@@ -54,6 +58,6 @@ public class Paths {
}
public static File convertToFile(final URI uri) {
return new File(toURI(uri.getPath()));
return new File(toURI(uri.getPath(), false));
}
}
@@ -135,7 +135,7 @@ class JavacFileManager extends ForwardingJavaFileManager<StandardJavaFileManager
}
private File findOutputDir(File src) {
File file = src.getParentFile();
File file = FileUtil.getParentFile(src);
while (file != null) {
for (Map.Entry<File, Set<File>> entry : myOutputsMap.entrySet()) {
if (entry.getValue().contains(file)) {