protected void scan() { if (configuration.getUrls() == null || configuration.getUrls().isEmpty()) { if (log != null) log.warn("given scan urls are empty. set urls in the configuration"); return; log.debug("going to scan these urls:\n{}", Joiner.on("\n").join(configuration.getUrls())); List<Future<?>> futures = Lists.newArrayList(); for (final URL url : configuration.getUrls()) { try { if (executorService != null) {
protected void scan() { if (configuration.getUrls() == null || configuration.getUrls().isEmpty()) { if (log != null) log.warn("given scan urls are empty. set urls in the configuration"); return; log.debug("going to scan these urls:\n" + Joiner.on("\n").join(configuration.getUrls())); List<Future<?>> futures = Lists.newArrayList(); for (final URL url : configuration.getUrls()) { try { if (executorService != null) {
private Map<String, String> getAllDocStrings0(ClassLoader classLoader) { final Configuration configuration = new ConfigurationBuilder() .filterInputsBy(new FilterBuilder().includePackage(path)) .setUrls(ClasspathHelper.forPackage(path, classLoader)) .addClassLoader(classLoader) .setScanners(new ResourcesScanner()); if (configuration.getUrls() == null || configuration.getUrls().isEmpty()) { return Collections.emptyMap(); } final Map<String, byte[]> files = new Reflections(configuration) .getResources(this::acceptFile).stream() .map(f -> { try { URL url = classLoader.getResource(f); if (url == null) { throw new IllegalStateException("not found: " + f); } return new SimpleImmutableEntry<>(f, Resources.toByteArray(url)); } catch (IOException e) { throw new UncheckedIOException(e); } }) .collect(toImmutableMap(Entry::getKey, Entry::getValue)); return getDocStringsFromFiles(files); }
protected void scan() { if (configuration.getUrls() == null || configuration.getUrls().isEmpty()) { if (log != null) log.warn("given scan urls are empty. set urls in the configuration"); return; log.debug("going to scan these urls:\n" + Joiner.on("\n").join(configuration.getUrls())); List<Future<?>> futures = Lists.newArrayList(); for (final URL url : configuration.getUrls()) { try { if (executorService != null) {
protected void scan() { if (configuration.getUrls() == null || configuration.getUrls().isEmpty()) { if (log != null) log.warn("given scan urls are empty. set urls in the configuration"); return; log.debug("going to scan these urls:\n" + Joiner.on("\n").join(configuration.getUrls())); List<Future<?>> futures = Lists.newArrayList(); for (final URL url : configuration.getUrls()) { try { if (executorService != null) {
/** * Builds a {@link Reflections} instance that will scan for classes in, and * load them from, the given class loader. * * @param classLoader The class loader to scan and load from. * @return A new {@link Reflections} instance. */ static Reflections createReflections(ClassLoader classLoader, String packagePrefix) { // We set up reflections to use the classLoader for loading classes // and also to use the classLoader to determine the list of URLs: ConfigurationBuilder configurationBuilder = new ConfigurationBuilder().addClassLoader(classLoader); if (StringUtils.isNotBlank(packagePrefix)) { configurationBuilder.addUrls(ClasspathHelper.forPackage(packagePrefix, classLoader)); } else { configurationBuilder.addUrls(ClasspathHelper.forClassLoader(classLoader)); } Reflections reflections = new Reflections(configurationBuilder); log.info("Reflections URLs: {}", reflections.getConfiguration().getUrls()); if (Main.configuration.classesReloadable && reflections.getConfiguration().getUrls().size() == 0 && StringUtils.isNotEmpty(Main.configuration.packagePrefix)) { log.info("It looks like no reloadable classes were found. Is '{}' the correct package prefix for your app?", Main.configuration.packagePrefix); } return reflections; } }
protected void scan() { if (configuration.getUrls() == null || configuration.getUrls().isEmpty()) { if (LOGGER != null) LOGGER.warning("given scan urls are empty. set urls in the configuration"); return; LOGGER.finest("going to scan these urls:\n" + Joiner.on("\n").join(configuration.getUrls())); List<Future<?>> futures = new ArrayList<>(); for (final URL url : configuration.getUrls()) { try { if (executorService != null) {