private Class<?> loadClass(String className) { WeldLogger.DEPLOYMENT_LOGGER.tracef("Falling back to reflection for %s", className); try { return classLoader.loadClass(className); } catch (ClassNotFoundException e) { throw WeldLogger.ROOT_LOGGER.cannotLoadClass(className, e); } }
private void handle(VirtualFile urlPath) { WeldLogger.DEPLOYMENT_LOGGER.tracef("scanning: %s", urlPath); handleDirectory(urlPath, null); }
private void handleDirectory(File file, String path) { WeldLogger.DEPLOYMENT_LOGGER.tracef("handling directory: %s", file); for (File child : file.listFiles()) { String newPath = (path == null) ? child.getName() : (path + '/' + child.getName()); if (child.isDirectory()) { handleDirectory(child, newPath); } else { handleFile(newPath, () -> child.toURI().toURL().openStream()); } } }
private void handle(String urlPath) { try { WeldLogger.DEPLOYMENT_LOGGER.tracef("scanning: %s", urlPath); if (urlPath.startsWith("file:")) { urlPath = urlPath.substring(5); } if (urlPath.indexOf('!') > 0) { urlPath = urlPath.substring(0, urlPath.indexOf('!')); } File file = new File(urlPath); if (file.isDirectory()) { handleDirectory(file, null); } else { handleArchiveByFile(file); } } catch (IOException ioe) { WeldLogger.DEPLOYMENT_LOGGER.couldNotReadEntries(ioe); } }
private void handleDirectory(VirtualFile file, String path) { WeldLogger.DEPLOYMENT_LOGGER.tracef("handling directory: %s", file); for (VirtualFile child : file.getChildren()) { String newPath = (path == null) ? child.getName() : (path + '/' + child.getName()); if (child.isDirectory()) { handleDirectory(child, newPath); } else { handleFile(newPath, () -> file.toURL().openStream()); } } }