From 386613909b63b33589bdb015ee65921608ef7fc6 Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Mon, 9 Apr 2012 11:41:11 -0400 Subject: [PATCH] hack ConfigImplUtil.urlToFile to make "file://whatever" with two slashes work This compounds the wrongness of that method. --- .../main/java/com/typesafe/config/impl/ConfigImplUtil.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/config/src/main/java/com/typesafe/config/impl/ConfigImplUtil.java b/config/src/main/java/com/typesafe/config/impl/ConfigImplUtil.java index 4cbcff7a..be15993c 100644 --- a/config/src/main/java/com/typesafe/config/impl/ConfigImplUtil.java +++ b/config/src/main/java/com/typesafe/config/impl/ConfigImplUtil.java @@ -150,6 +150,10 @@ final public class ConfigImplUtil { // 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()); } }