private void handle(Set<String> paths) throws IOException, ClassNotFoundException { for (String urlPath : paths) { log.fine("scanning: " + urlPath); File file = new File(urlPath); if (file.isDirectory()) { handle(file, packageName); } else { handleArchiveByFile(file); } } }
private void handle(File file, String packageName) throws ClassNotFoundException { for (File child : file.listFiles()) { if (!child.isDirectory() && child.getName().endsWith(SUFFIX_CLASS)) { final String packagePrefix = packageName.length() > 0 ? packageName + "." : packageName; String className = packagePrefix + child.getName().substring(0, child.getName().lastIndexOf(SUFFIX_CLASS)); foundClass(className, prefix + className.replace( '.', '/' ) + SUFFIX_CLASS ); } else if (child.isDirectory() && addRecursively) { handle(child, packageName + "." + child.getName()); } } }
private void handle(Set<String> paths) throws IOException, ClassNotFoundException { for (String urlPath : paths) { log.fine("scanning: " + urlPath); File file = new File(urlPath); if (file.isDirectory()) { handle(file, packageName); } else { handleArchiveByFile(file); } } }
private void handle(File file, String packageName) throws ClassNotFoundException { for (File child : file.listFiles()) { if (!child.isDirectory() && child.getName().endsWith(SUFFIX_CLASS)) { final String packagePrefix = packageName.length() > 0 ? packageName + "." : packageName; String className = packagePrefix + child.getName().substring(0, child.getName().lastIndexOf(SUFFIX_CLASS)); foundClass(className, prefix + className.replace( '.', '/' ) + SUFFIX_CLASS ); } else if (child.isDirectory() && addRecursively) { handle(child, packageName + "." + child.getName()); } } }
public void scanPackage() { try { Set<String> paths = new HashSet<String>(); for (URL url : loadResources(packageNamePath)) { String urlPath = url.getFile(); urlPath = URLDecoder.decode(urlPath, "UTF-8"); if (urlPath.startsWith("file:")) { urlPath = urlPath.substring(5); } if (urlPath.indexOf('!') > 0) { urlPath = urlPath.substring(0, urlPath.indexOf('!')); } paths.add(urlPath); } handle(paths); } catch (IOException ioe) { log.log(Level.WARNING, "could not read: " + packageName, ioe); } catch (ClassNotFoundException ioe) { log.log(Level.WARNING, "Class coud not be loaded in package: " + packageName, ioe); } }
public void scanPackage() { try { Set<String> paths = new HashSet<String>(); for (URL url : loadResources(packageNamePath)) { String urlPath = url.getFile(); urlPath = URLDecoder.decode(urlPath, "UTF-8"); if (urlPath.startsWith("file:")) { urlPath = urlPath.substring(5); } if (urlPath.indexOf('!') > 0) { urlPath = urlPath.substring(0, urlPath.indexOf('!')); } paths.add(urlPath); } handle(paths); } catch (IOException ioe) { log.log(Level.WARNING, "could not read: " + packageName, ioe); } catch (ClassNotFoundException ioe) { log.log(Level.WARNING, "Class coud not be loaded in package: " + packageName, ioe); } }