Commits

mrdon  committed 26fede4

Improving wildcards for config searches
XW-581

git-svn-id: http://svn.opensymphony.com/svn/xwork/trunk@1751e221344d-f017-0410-9bd5-d282ab1896d7

  • Participants
  • Parent commits a169a0e

Comments (0)

Files changed (1)

File src/java/com/opensymphony/xwork2/config/providers/XmlConfigurationProvider.java

 import java.util.List;
 import java.util.Map;
 import java.util.Set;
+import java.util.Vector;
 
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import com.opensymphony.xwork2.inject.Inject;
 import com.opensymphony.xwork2.inject.Scope;
 import com.opensymphony.xwork2.util.ClassLoaderUtil;
+import com.opensymphony.xwork2.util.ClassPathFinder;
 import com.opensymphony.xwork2.util.DomHelper;
 import com.opensymphony.xwork2.util.FileManager;
 import com.opensymphony.xwork2.util.TextUtils;
                         if (nodeName.equals("include")) {
                             String includeFileName = child.getAttribute("file");
                             if(includeFileName.indexOf('*') != -1 ) {
-                                handleWildCardIncludes(includeFileName, docs, child);
-                        }
+                                // handleWildCardIncludes(includeFileName, docs, child);
+                            	ClassPathFinder wildcardFinder = new ClassPathFinder();
+                            	wildcardFinder.setPattern(includeFileName);
+                            	Vector<String> wildcardMatches = wildcardFinder.findMatches();
+                            	for (String match : wildcardMatches) {
+                            		docs.addAll(loadConfigurationFiles(match, child));
+                            	}
+                            }
                             else {
+                            	
                                 docs.addAll(loadConfigurationFiles(includeFileName, child));    
                             }    
                     }