From: markt Date: Thu, 24 Dec 2009 12:49:46 +0000 (+0000) Subject: Clean up i18n resources after JarScanner changes X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=b1709309e0bde048929661bd51623fc8fd7172cb;p=tomcat7.0 Clean up i18n resources after JarScanner changes git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@893744 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/catalina/startup/LocalStrings.properties b/java/org/apache/catalina/startup/LocalStrings.properties index 54739b94d..63ffd540a 100644 --- a/java/org/apache/catalina/startup/LocalStrings.properties +++ b/java/org/apache/catalina/startup/LocalStrings.properties @@ -97,11 +97,6 @@ hostConfig.stop=HostConfig: Processing STOP hostConfig.undeploy=Undeploying context [{0}] hostConfig.undeploy.error=Error undeploying web application at context path {0} hostConfig.undeploying=Undeploying deployed web applications -jarScan.classloaderFail=Failed to scan [{0}] from classloader hierarchy -jarScan.classloaderStart=Scanning for JARs in classloader hierarchy -jarScan.jarUrlStart=Scanning JAR at URL [{0}] -jarScan.webinflibFail=Failed to scan JAR [{0}] from WEB-INF/lib -jarScan.webinflibStart=Scanning WEB-INF/lib for JARs tldConfig.addListeners=Adding {0} listeners from TLD files tldConfig.cce=Lifecycle event data object {0} is not a Context tldConfig.dirFail=Failed to process directory [{0}] for TLD files diff --git a/java/org/apache/jasper/resources/LocalStrings.properties b/java/org/apache/jasper/resources/LocalStrings.properties index 26677be80..725f7fc19 100644 --- a/java/org/apache/jasper/resources/LocalStrings.properties +++ b/java/org/apache/jasper/resources/LocalStrings.properties @@ -456,9 +456,4 @@ jsp.error.page.conflict.trimdirectivewhitespaces=Page directive: illegal to have jsp.error.tag.conflict.trimdirectivewhitespaces=Tag directive: illegal to have multiple occurrences of 'trimDirectiveWhitespaces' with different values (old: {0}, new: {1}) # JarScanner -jsp.warning.noJarScanner=Warning: No org.apache.tomcat.JarScanner set in ServletContext. Falling back to internal JarScanner implementation. -jsp.jarScan.webinflibStart=Scanning WEB-INF/lib for JARs -jsp.jarScan.webinflibFail=Failed to scan JAR [{0}] from WEB-INF/lib -jsp.jarScan.classloaderStart=Scanning for JARs in classloader hierarchy -jsp.jarScan.classloaderFail=Failed to scan [{0}] from classloader hierarchy -jsp.jarScan.jarUrlStart=Scanning JAR at URL [{0}] +jsp.warning.noJarScanner=Warning: No org.apache.tomcat.JarScanner set in ServletContext. Falling back to default JarScanner implementation. diff --git a/java/org/apache/tomcat/util/scan/Constants.java b/java/org/apache/tomcat/util/scan/Constants.java new file mode 100644 index 000000000..52e11c4c0 --- /dev/null +++ b/java/org/apache/tomcat/util/scan/Constants.java @@ -0,0 +1,34 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.tomcat.util.scan; + +/** + * String constants for the scan package. + */ +public final class Constants { + + public static final String Package = "org.apache.tomcat.util.scan"; + + public static final String SKIP_JARS_PROPERTY = + "tomcat.util.scan.DefaultJarScanner.jarsToSkip"; + + public static final String JAR_EXT = ".jar"; + public static final String WEB_INF_LIB = "/WEB-INF/lib/"; + + +} diff --git a/java/org/apache/tomcat/util/scan/DefaultJarScanner.java b/java/org/apache/tomcat/util/scan/DefaultJarScanner.java index 0c77fde99..ad81dc116 100644 --- a/java/org/apache/tomcat/util/scan/DefaultJarScanner.java +++ b/java/org/apache/tomcat/util/scan/DefaultJarScanner.java @@ -31,7 +31,6 @@ import java.util.StringTokenizer; import javax.servlet.ServletContext; -import org.apache.catalina.startup.Constants; import org.apache.juli.logging.Log; import org.apache.juli.logging.LogFactory; import org.apache.tomcat.JarScanner; @@ -54,12 +53,6 @@ import org.apache.tomcat.util.res.StringManager; */ public class DefaultJarScanner implements JarScanner { - public static final String SKIP_JARS_PROPERTY = - "tomcat.util.scan.DefaultJarScanner.jarsToSkip"; - - private static final String JAR_EXT = ".jar"; - private static final String WEB_INF_LIB = "/WEB-INF/lib/"; - private static final Log log = LogFactory.getLog(DefaultJarScanner.class); private static final Set defaultJarsToSkip = new HashSet(); @@ -71,7 +64,7 @@ public class DefaultJarScanner implements JarScanner { StringManager.getManager(Constants.Package); static { - String jarList = System.getProperty(SKIP_JARS_PROPERTY); + String jarList = System.getProperty(Constants.SKIP_JARS_PROPERTY); if (jarList != null) { StringTokenizer tokenizer = new StringTokenizer(jarList, ","); while (tokenizer.hasMoreElements()) { @@ -143,12 +136,12 @@ public class DefaultJarScanner implements JarScanner { } // Scan WEB-INF/lib - Set dirList = context.getResourcePaths(WEB_INF_LIB); + Set dirList = context.getResourcePaths(Constants.WEB_INF_LIB); if (dirList != null) { Iterator it = dirList.iterator(); while (it.hasNext()) { String path = it.next(); - if (path.endsWith(JAR_EXT) && + if (path.endsWith(Constants.JAR_EXT) && !ignoredJars.contains( path.substring(path.lastIndexOf('/')+1))) { // Need to scan this JAR @@ -183,7 +176,7 @@ public class DefaultJarScanner implements JarScanner { // in WEB-INF/lib we have already scanned if (!(ignoredJars.contains(jarName) || urls[i].toString().contains( - WEB_INF_LIB + jarName))) { + Constants.WEB_INF_LIB + jarName))) { try { process(callback, urls[i]); } catch (IOException ioe) { @@ -216,7 +209,7 @@ public class DefaultJarScanner implements JarScanner { } else { String urlStr = url.toString(); if (urlStr.startsWith("file:") || urlStr.startsWith("jndi:")) { - if (urlStr.endsWith(JAR_EXT)) { + if (urlStr.endsWith(Constants.JAR_EXT)) { URL jarURL = new URL("jar:" + urlStr + "!/"); callback.scan((JarURLConnection) jarURL.openConnection()); } else { @@ -254,7 +247,7 @@ public class DefaultJarScanner implements JarScanner { String name = null; String path = url.getPath(); - int end = path.indexOf(JAR_EXT); + int end = path.indexOf(Constants.JAR_EXT); if (end != -1) { int start = path.lastIndexOf('/', end); name = path.substring(start + 1, end + 4); diff --git a/java/org/apache/tomcat/util/scan/LocalStrings.properties b/java/org/apache/tomcat/util/scan/LocalStrings.properties new file mode 100644 index 000000000..27b59ddf1 --- /dev/null +++ b/java/org/apache/tomcat/util/scan/LocalStrings.properties @@ -0,0 +1,20 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +jarScan.classloaderFail=Failed to scan [{0}] from classloader hierarchy +jarScan.classloaderStart=Scanning for JARs in classloader hierarchy +jarScan.jarUrlStart=Scanning JAR at URL [{0}] +jarScan.webinflibFail=Failed to scan JAR [{0}] from WEB-INF/lib +jarScan.webinflibStart=Scanning WEB-INF/lib for JARs