From 1bfaa78fa237c9685eeaf97b6d2331932bb12c42 Mon Sep 17 00:00:00 2001 From: kkolinko Date: Fri, 2 Oct 2009 10:39:21 +0000 Subject: [PATCH] Use proper method to construct an URL string. File.toURI() takes care of absolute paths, trailing slashes in the names of directories, encoding of special characters such as '%'. Based on a suggestion by Rainer Jung. git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@820954 13f79535-47bb-0310-9956-ffa450edef68 --- java/org/apache/catalina/loader/VirtualWebappLoader.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/java/org/apache/catalina/loader/VirtualWebappLoader.java b/java/org/apache/catalina/loader/VirtualWebappLoader.java index d77a590b0..49ba01f61 100644 --- a/java/org/apache/catalina/loader/VirtualWebappLoader.java +++ b/java/org/apache/catalina/loader/VirtualWebappLoader.java @@ -91,11 +91,7 @@ public class VirtualWebappLoader extends WebappLoader { if (!file.exists()) { continue; } - if (file.isDirectory()) { - addRepository("file:/" + file.getAbsolutePath() + "/"); - } else { - addRepository("file:/" + file.getAbsolutePath()); - } + addRepository(file.toURI().toString()); } super.start(); -- 2.11.0