}
}
public static List<URL> search(URL baseLocation, final Filter filter) throws IOException
{
final URLResourceHandler resourceHandler = URLResourceHandlersRegistry.getURLResourceHandler(baseLocation.getProtocol());
List<ScannerRegistration> scanners = new ArrayList<ScannerRegistration>();
ScannerRegistration scanner = new ScannerRegistration(new AbstractScanner()
{
@Override
public Filter getScannerFilter()
{
return filter;
}
@Override
public ScannerCallback getScannerCallback()
{
return null;
}
@Override
public void resetScanner()
{
}
});
scanners.add(scanner);
scanner.setScanned();
scanner.startScanning();
URLIterator iterator = resourceHandler.getDirectoryIteratorFactory().create(baseLocation, scanners);
iterator.search();
List<URL> result = new ArrayList<URL>();
for (ScannerMatch match : scanner.getAllMatches())