Index: AbstractSpecificationResolver.java =================================================================== RCS file: /home/cvspublic/jakarta-tapestry/framework/src/org/apache/tapestry/resolver/AbstractSpecificationResolver.java,v retrieving revision 1.8 diff -r1.8 AbstractSpecificationResolver.java 52a53,54 > > private RecursiveFileLocator _webInfFileLocator; 67a70,75 > > boolean _webInfIsFileLocation = _webInfLocation.getResourceURL().getProtocol().equals("file"); > > if (_webInfIsFileLocation) { > _webInfFileLocator = new RecursiveFileLocator(_webInfLocation); > } 197a206,213 > } > > /** > * @return the RecursiveFileLocator instance for finding files in any directory under > * WEB-INF in an exploded WAR file > */ > protected RecursiveFileLocator getWebInfFileLocator() { > return _webInfFileLocator; Index: ComponentSpecificationResolver.java =================================================================== RCS file: /home/cvspublic/jakarta-tapestry/framework/src/org/apache/tapestry/resolver/ComponentSpecificationResolver.java,v retrieving revision 1.14 diff -r1.14 ComponentSpecificationResolver.java 205a206,209 > > if (foundRecursivelyInWebInf(expectedName)) { > return; > } 258c262,285 < --- > > > /** > * Search recursively through the folder structure under WEB-INF > * to find the file with the expectedName. If found the component specification is loaded > * and installed. > * > * @return true if the file was found under WEB-INF or false if not. > * > **/ > > private boolean foundRecursivelyInWebInf(String expectedName) { > > RecursiveFileLocator locator = getWebInfFileLocator(); > if (locator != null) { > IResourceLocation location = locator.resolveLocation(expectedName); > if (location != null) { > if ( found(location) ) { > return true; > } > } > } > return false; > } Index: PageSpecificationResolver.java =================================================================== RCS file: /home/cvspublic/jakarta-tapestry/framework/src/org/apache/tapestry/resolver/PageSpecificationResolver.java,v retrieving revision 1.9 diff -r1.9 PageSpecificationResolver.java 164a165,168 > if (foundRecursivelyInWebInf(expectedName)) { > return; > } > 271a276,286 > > /** > * Search recursively through the folder structure under WEB-INF > * to find the file with the expectedName. If found the page specification is loaded > * and installed. > * > * @return true if the file was found under WEB-INF or false if not. > * > **/ > > private boolean foundRecursivelyInWebInf(String expectedName) { 272a288,298 > RecursiveFileLocator locator = getWebInfFileLocator(); > if (locator != null) { > IResourceLocation location = locator.resolveLocation(expectedName); > if (location != null) { > if ( found(location) ) { > return true; > } > } > } > return false; > } Index: RecursiveFileLocator.java =================================================================== RCS file: RecursiveFileLocator.java diff -N RecursiveFileLocator.java 0a1,137 > // RecursiveFileLocator.java > // > // Copyright 2004 Michael J. Henderson & Associates LLC > // > // Licensed 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.tapestry.resolver; > > import java.io.File; > import java.net.URL; > import java.util.ArrayList; > import java.util.HashMap; > import java.util.Iterator; > import java.util.List; > import java.util.Map; > > import org.apache.commons.logging.Log; > import org.apache.commons.logging.LogFactory; > import org.apache.tapestry.IResourceLocation; > > /** > * @author Mike Henderson > * > */ > public class RecursiveFileLocator { > > private static final Log LOG = LogFactory.getLog(RecursiveFileLocator.class); > > private IResourceLocation _location; > > private Map _locations = new HashMap(); > > public RecursiveFileLocator(IResourceLocation location) { > > _location = location; > } > > /* (non-Javadoc) > * @see org.apache.tapestry.INamespace#getPageSpecification(java.lang.String) > */ > public IResourceLocation resolveLocation(String expectedName) { > if (LOG.isDebugEnabled()) { > LOG.debug("getLocation("+expectedName+")"); > } > IResourceLocation location = _resolveThisFolderLocation(expectedName); > if (location == null) { > location = _resolveChildFolderLocation(expectedName); > } > return location; > } > > > private IResourceLocation _resolveThisFolderLocation(String expectedName) { > if (LOG.isDebugEnabled()) { > LOG.debug("_resolveThisFolderLocation("+expectedName+")"); > } > IResourceLocation location = (IResourceLocation)_locations.get(expectedName); > if (location == null) { > location = _location.getRelativeLocation(_location.getPath()+"/"+expectedName); > > if (location.getResourceURL() == null) { > return null; > } > _locations.put(expectedName, location); > } > return location; > } > > > private IResourceLocation _resolveChildFolderLocation(String expectedName) { > List children = _getChildFolderLocators(); > Iterator iterator = children.iterator(); > while (iterator.hasNext()) { > RecursiveFileLocator child = (RecursiveFileLocator)iterator.next(); > > if (LOG.isDebugEnabled()) { > LOG.debug("_resolveChildFolderLocation() child = " + child + ", expectedName = " + expectedName); > } > IResourceLocation location = child.resolveLocation(expectedName); > if (location != null) { > return location; > } > } > return null; > } > > public String toString() { > return "RecursiveFileLocator { "+_location+" }"; > } > > private List _children = new ArrayList(); > private boolean _childrenLoaded = false; > > private List _getChildFolderLocators() { > if (!_childrenLoaded) { > _loadChildFolderLocators(); > _childrenLoaded = true; > } > return _children; > } > > private void _loadChildFolderLocators() { > > if (LOG.isDebugEnabled()) { > LOG.debug("_loadChildFolderLocators() this = " + this); > } > URL url = _location.getResourceURL(); > if (url == null) { > return; > } > String path = url.getFile(); > File file = new File(path); > if (file.isDirectory()) { > File[] files = file.listFiles(); > for (int i = 0; i < files.length; i++) { > File f = files[i]; > if (f.isDirectory()) { > RecursiveFileLocator child = new RecursiveFileLocator(_location.getRelativeLocation(f.getName())); > if (LOG.isDebugEnabled()) { > LOG.debug("_loadChildFolderLocators() child = " + child); > } > _children.add(child); > } > } > } > } > }