From bbc59d88fc7a7ed2cdb9bf3fefc0f5c3d639fb4e Mon Sep 17 00:00:00 2001 From: markt Date: Thu, 1 May 2008 21:25:01 +0000 Subject: [PATCH] Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=43150 # in installation path stops Tomcat starting git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@652669 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/catalina/startup/ClassLoaderFactory.java | 10 +++++----- java/org/apache/jasper/JspCompilationContext.java | 18 +++++++++--------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/java/org/apache/catalina/startup/ClassLoaderFactory.java b/java/org/apache/catalina/startup/ClassLoaderFactory.java index a9d36b717..53943492e 100644 --- a/java/org/apache/catalina/startup/ClassLoaderFactory.java +++ b/java/org/apache/catalina/startup/ClassLoaderFactory.java @@ -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); } } diff --git a/java/org/apache/jasper/JspCompilationContext.java b/java/org/apache/jasper/JspCompilationContext.java index efa251f0c..8e61efb0b 100644 --- a/java/org/apache/jasper/JspCompilationContext.java +++ b/java/org/apache/jasper/JspCompilationContext.java @@ -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")); } -- 2.11.0