/** * Finds a given resource from within the {@link #bundle}. * * @param name The resource name. * @return URLs of resources. * @throws IOException */ @SuppressWarnings({"unchecked", "rawtypes"}) protected Enumeration findResources(String name) throws IOException { return bundle.getResources(name); }
for ( Bundle bundle : bundles ) { try { final Enumeration<URL> resources = bundle.getResources( name ); if ( resources != null ) { enumerations.add( resources );
@SuppressWarnings("unchecked") @Override protected Enumeration<URL> findResources(String name) throws IOException { return bundle.getResources(name); }
public Enumeration<URL> getResources(String name) throws IOException { Bundle current = systemBundle; if (current == null) return null; return current.getResources(name); }
@SuppressWarnings("unchecked") @Override protected final Enumeration<URL> findResources(final String resName) throws IOException { return bundle.getResources(resName); }
@SuppressWarnings("unchecked") @Override protected Enumeration<URL> findResources(String resName) throws IOException { return bundle.getResources(resName); }
@SuppressWarnings("unchecked") protected Enumeration<URL> findResources(String name) throws IOException { return bundle.getResources(name); }
@SuppressWarnings("unchecked") @Override protected Enumeration<URL> findResources(String resName) throws IOException { return bundle.getResources(resName); }
@Override public Enumeration<URL> getResources(String name) throws IOException { Enumeration<URL> resources = bundle.getResources(name); if (resources==null) { // This check is needed, because ClassLoader.getResources() // expects us to return an empty enumeration. resources = EMPTY_URLS; } return resources; }
@SuppressWarnings("unchecked") @Override protected Enumeration<URL> findResources(String resName) throws IOException { return bundle.getResources(resName); }
public Enumeration<URL> getResources(String name) throws IOException { Bundle current = systemBundle; if (current == null) return null; return current.getResources(name); }
@SuppressWarnings("unchecked") public Enumeration<URL> run() throws IOException { return bundle.getResources(name); }
@Override protected Enumeration findResources(String name) throws IOException { try { return acl.getResources(name); } catch (IOException e) { return bundle.getResources(name); } } };
Bundle bundle = FrameworkUtil.getBundle(this.getClass()); Enumeration<URL> resources = bundle.getResources("/com/me/myapp/style.css"); if (resources != null) { URL myCSS = resources.nextElement(); }
@SuppressWarnings("unchecked") @Override protected Enumeration<URL> findResources(String name) throws IOException { Enumeration<URL> urls = bundle.getResources(name); if (urls == null) { List<URL> list = Collections.emptyList(); return Collections.enumeration(list); } else { return urls; } } }
public Enumeration<URL> getResources(String name) throws IOException { ArrayList<URL> allResources = new ArrayList<URL>(); for (Bundle bundle : bundles) { Enumeration<URL> e = bundle.getResources(name); addToList(allResources, e); } return Collections.enumeration(allResources); }
public Iterator<URL> getResources(String name) { try { final Bundle bundle = bundleContext.getBundle(); final Enumeration<URL> enumeration = bundle.getResources(name); if (null == enumeration) { return null; } return new EnumerationAdapter<URL>(enumeration); } catch (IOException e) { return Collections.<URL> emptyList().iterator(); } }
public Enumeration<URL> getResources(String name) throws IOException { ArrayList<URL> allResources = new ArrayList<URL>(); for (Bundle b : bundles) { Enumeration<URL> e = b.getResources(name); addToList(allResources, e); } return Collections.enumeration(allResources); }
@Override public <T> Enumeration<URL> getResourcesFromBundle(String type, Bundle b) throws IOException { if (EmbeddedFelixFramework.isExtensionBundle(b)) { return getClass().getClassLoader().getResources(type); } else { return b.getResources(type); } }
@Override public Enumeration<URL> loadResourcesAsURL(String uri) { ObjectHelper.notEmpty(uri, "uri"); try { String resolvedName = resolveUriPath(uri); return bundleContext.getBundle().getResources(resolvedName); } catch (IOException e) { throw new RuntimeException("Cannot load resource: " + uri, e); } }