Permalink
Browse files

hack ConfigImplUtil.urlToFile to make "file://whatever" with two slas…

…hes work

This compounds the wrongness of that method.
  • Loading branch information...
1 parent 3b7d99a commit 386613909b63b33589bdb015ee65921608ef7fc6 @havocp havocp committed Apr 9, 2012
Showing with 4 additions and 0 deletions.
  1. +4 −0 config/src/main/java/com/typesafe/config/impl/ConfigImplUtil.java
@@ -150,6 +150,10 @@ static File urlToFile(URL url) {
// this handles some stuff like file:///c:/Whatever/
// apparently but mangles handling of hex escapes
return new File(url.getPath());
+ } catch (IllegalArgumentException e) {
+ // file://foo with double slash causes
+ // IllegalArgumentException "url has an authority component"
+ return new File(url.getPath());
}
}

0 comments on commit 3866139

Please sign in to comment.