@Override public URL getResource( final String name ) { final String normalizedname = Path.normalizeResourcePath( name ); return getBundle().getResource( normalizedname ); }
private URL getResource(Bundle bundle, final String name) { final String normalizedname = Path.normalizeResourcePath(name); LOG.debug("Searching bundle [" + bundle + "] for resource [" + normalizedname + "]"); return bundle.getResource(normalizedname); }
/** * {@inheritDoc} */ @Override public URL getResource(final String name) { final String normalizedname = Path.normalizeResourcePath(name); LOG.debug("Searching bundle [" + bundle + "] for resource [" + normalizedname + "]"); return bundle.getResource(normalizedname); }
private Set<String> getResourcePaths(Bundle bundle, final String name) { final String normalizedname = Path.normalizeResourcePath(name); LOG.debug("Searching bundle [" + bundle + "] for resource paths of [" + normalizedname + "]"); final Enumeration<String> entryPaths = bundle .getEntryPaths(normalizedname); if (entryPaths == null || !entryPaths.hasMoreElements()) { return null; } Set<String> foundPaths = new HashSet<>(); while (entryPaths.hasMoreElements()) { foundPaths.add(entryPaths.nextElement()); } return foundPaths; }
/** * Search resource paths within the bundle jar. {@inheritDoc} */ @Override public Set<String> getResourcePaths(final String name) { final String normalizedname = Path.normalizeResourcePath(name); LOG.debug("Searching bundle [" + bundle + "] for resource paths of [" + normalizedname + "]"); final Enumeration<String> entryPaths = bundle .getEntryPaths(normalizedname); if (entryPaths == null || !entryPaths.hasMoreElements()) { return null; } Set<String> foundPaths = new HashSet<>(); while (entryPaths.hasMoreElements()) { foundPaths.add(entryPaths.nextElement()); } return foundPaths; }