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
if (!file.exists()) {
continue;
}
- if (file.isDirectory()) {
- addRepository("file:/" + file.getAbsolutePath() + "/");
- } else {
- addRepository("file:/" + file.getAbsolutePath());
- }
+ addRepository(file.toURI().toString());
}
super.start();