final String path = FileUtils.getPath(getClass(), sourceAntPath); final Iterable<URL> urls = OSGiUtils.findEntriesByPattern(context, path); Validate.notNull(urls, "Could not search bundles for resources for Ant Path '%s'", path);
final String path = FileUtils.getPath(getClass(), sourceAntPath); final Iterable<URL> urls = OSGiUtils.findEntriesByPattern(context, path); Validate.notNull(urls, "Could not search bundles for resources for Ant Path '%s'", path);
final String path = FileUtils.getPath(getClass(), sourceAntPath); final Iterable<URL> urls = OSGiUtils.findEntriesByPattern(context, path); Validate.notNull(urls, "Could not search bundles for resources for Ant Path '%s'", path);
/** * This method creates a banner.txt file inside generated project that will * be displayed when the generated Spring Boot application starts. * * @param Pom * module where banner.txt should be generated */ private void addBannerFile(Pom module) { LogicalPath resourcesPath = LogicalPath.getInstance(Path.SRC_MAIN_RESOURCES, module.getModuleName()); String sourceAntPath = "banner/banner.txt"; String targetDirectory = getPathResolver().getIdentifier(resourcesPath, ""); if (!getFileManager().exists(targetDirectory)) { getFileManager().createDirectory(targetDirectory); } final String path = FileUtils.getPath(getClass(), sourceAntPath); final Iterable<URL> urls = OSGiUtils.findEntriesByPattern(context, path); Validate.notNull(urls, "Could not search bundles for resources for Ant Path '%s'", path); for (final URL url : urls) { final String fileName = url.getPath().substring(url.getPath().lastIndexOf("/") + 1); try { String contents = IOUtils.toString(url); getFileManager().createOrUpdateTextFileIfRequired(targetDirectory + fileName, contents, false); } catch (final Exception e) { throw new IllegalStateException(e); } } }
String path = FileUtils.getPath(getClass(), sourceAntPath); Collection<URL> urls = OSGiUtils.findEntriesByPattern(context, path); Validate.notNull(urls,
String path = FileUtils.getPath(getClass(), sourceAntPath); Collection<URL> urls = OSGiUtils.findEntriesByPattern( context.getBundleContext(), path);
final String path = FileUtils.getPath(getClass(), sourceAntPath); final Iterable<URL> urls = OSGiUtils.findEntriesByPattern(context, path); Validate.notNull(urls, "Could not search bundles for resources for Ant Path '%s'", path);