URL url = getURL(path);
if (visit)
{
if (context == null)
context = new DefaultResourceContext(url, path, classLoader);
if (filter == null || filter.accepts(context))
visitor.visit(context);
}
if (file == null)
file = getFile(url);
if (file.isFile())
return;
File[] files = file.listFiles();
if (files != null && files.length > 0)
{
if (path.endsWith("/") == false)
path += "/";
for (File child : files)
{
String childPath = path + child.getName();
ResourceContext childContext = new DefaultResourceContext(getURL(childPath), childPath, classLoader);
if (recurseFilter == null || recurseFilter.accepts(childContext))
{
visitPath(child, childPath, visitor, filter, recurseFilter, classLoader, included, includedFilter, excluded, excludedFilter, childContext);
}
}