Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=43150
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Thu, 1 May 2008 21:25:01 +0000 (21:25 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Thu, 1 May 2008 21:25:01 +0000 (21:25 +0000)
# in installation path stops Tomcat starting

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@652669 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/startup/ClassLoaderFactory.java
java/org/apache/jasper/JspCompilationContext.java

index a9d36b7..5394349 100644 (file)
@@ -121,7 +121,7 @@ public final class ClassLoaderFactory {
                 if (!file.exists() || !file.canRead())
                     continue;
                 file = new File(file.getCanonicalPath() + File.separator);
-                URL url = file.toURL();
+                URL url = file.toURI().toURL();
                 if (log.isDebugEnabled())
                     log.debug("  Including directory " + url);
                 list.add(url);
@@ -143,7 +143,7 @@ public final class ClassLoaderFactory {
                     File file = new File(directory, filenames[j]);
                     if (log.isDebugEnabled())
                         log.debug("  Including jar file " + file.getAbsolutePath());
-                    URL url = file.toURL();
+                    URL url = file.toURI().toURL();
                     list.add(url);
                 }
             }
@@ -201,7 +201,7 @@ public final class ClassLoaderFactory {
                     if (!directory.exists() || !directory.isDirectory() ||
                         !directory.canRead())
                          continue;
-                    URL url = directory.toURL();
+                    URL url = directory.toURI().toURL();
                     if (log.isDebugEnabled())
                         log.debug("  Including directory " + url);
                     list.add(url);
@@ -210,7 +210,7 @@ public final class ClassLoaderFactory {
                     file = new File(file.getCanonicalPath());
                     if (!file.exists() || !file.canRead())
                         continue;
-                    URL url = file.toURL();
+                    URL url = file.toURI().toURL();
                     if (log.isDebugEnabled())
                         log.debug("  Including jar file " + url);
                     list.add(url);
@@ -234,7 +234,7 @@ public final class ClassLoaderFactory {
                         if (log.isDebugEnabled())
                             log.debug("    Including glob jar file "
                                 + file.getAbsolutePath());
-                        URL url = file.toURL();
+                        URL url = file.toURI().toURL();
                         list.add(url);
                     }
                 }
index efa251f..8e61efb 100644 (file)
@@ -656,19 +656,19 @@ public class JspCompilationContext {
     protected void createOutputDir() {
         String path = null;
         if (isTagFile()) {
-           String tagName = tagInfo.getTagClassName();
-            path = tagName.replace('.', '/');
-           path = path.substring(0, path.lastIndexOf('/'));
+            String tagName = tagInfo.getTagClassName();
+            path = tagName.replace('.', File.separatorChar);
+            path = path.substring(0, path.lastIndexOf(File.separatorChar));
         } else {
-            path = getServletPackageName().replace('.', '/');
-       }
+            path = getServletPackageName().replace('.',File.separatorChar);
+        }
 
             // Append servlet or tag handler path to scratch dir
             try {
-                baseUrl = options.getScratchDir().toURL();
-                String outUrlString = baseUrl.toString() + '/' + path;
-                URL outUrl = new URL(outUrlString);
-                outputDir = outUrl.getFile() + File.separator;
+                File base = options.getScratchDir();
+                baseUrl = base.toURI().toURL();
+                outputDir = base.getAbsolutePath() + File.separator + path + 
+                    File.separator;
                 if (!makeOutputDir()) {
                     throw new IllegalStateException(Localizer.getMessage("jsp.error.outputfolder"));
                 }