@Test public void test_folder_with_plus_chars_scan() throws IOException { String resourceName = "some_resource.txt"; ResourceExistsFilter filter = new ResourceExistsFilter(resourceName); ClasspathScanner scanner = new ClasspathScanner(filter); File scanDir = new File("./target/folder+with+plus"); scanDir.delete(); scanDir.mkdirs(); FileWriter writer = new FileWriter(new File(scanDir, resourceName)); try { writer.write("something...."); writer.flush(); } finally { writer.close(); } scanner.scan(scanDir.toURI().toURL()); Assert.assertTrue(filter.resourceExists()); }
public void scan(URL url) throws IOException { File file = toClassPathFile(url); if (file.exists()) { if (file.isDirectory()) { handleDirectory(file, url.getRef()); } else { handleArchive(file); } } else { CommonCoreLogger.ROOT_LOGGER.unknownClasspathURL(file.getAbsolutePath()); } }
ClasspathScanner { public void scan(URL url) throws IOException { File file = toClassPathFile(url); if (file.exists()) { if (file.isDirectory()) { handleDirectory(file, url.getRef()); } else { handleArchive(file); } } else { CommonCoreLogger.ROOT_LOGGER.unknownClasspathURL(file.getAbsolutePath()); } } }
ClasspathScanner { public void scan(URL url) throws IOException { File file = toClassPathFile(url); if (file.exists()) { if (file.isDirectory()) { handleDirectory(file, url.getRef()); } else { handleArchive(file); } } else { CommonCoreLogger.ROOT_LOGGER.unknownClasspathURL(file.getAbsolutePath()); } } ClasspathScanner(Filter filter); }
ClasspathScanner { public void scan(URL url) throws IOException { File file = toClassPathFile(url); if (file.exists()) { if (file.isDirectory()) { handleDirectory(file, url.getRef()); } else { handleArchive(file); } } else { CommonCoreLogger.ROOT_LOGGER.unknownClasspathURL(file.getAbsolutePath()); } } ClasspathScanner(Filter filter); void scan(URL url); static File toClassPathFile(URL classPathURL); }
ClasspathScanner { public void scan(URL url) throws IOException { File file = toClassPathFile(url); if (file.exists()) { if (file.isDirectory()) { handleDirectory(file, url.getRef()); } else { handleArchive(file); } } else { CommonCoreLogger.ROOT_LOGGER.unknownClasspathURL(file.getAbsolutePath()); } } ClasspathScanner(Filter filter); void scan(URL url); static File toClassPathFile(URL classPathURL);  }