/** * This method is used to check if the specified {@code Bundle} contains resource files providing automation * resources. * * @param bundle is a {@link Bundle} object to check. * @return <tt>true</tt> if the specified {@link Bundle} contains resource files providing automation * resources, <tt>false</tt> otherwise. */ private boolean isAnAutomationProvider(Bundle bundle) { return bundle.getEntryPaths(AbstractResourceBundleProvider.PATH) != null; }
@Override protected Enumeration<URL> findResources(String name) throws IOException { return bundle.getEntryPaths(name); } }
public Enumeration getEntryPaths(String arg0) { return bundle.getEntryPaths(arg0); }
@SuppressWarnings("rawtypes") public Enumeration getEntryPaths(String path) { return bundle.getEntryPaths(path); }
/** * This method is used to check if the specified {@code Bundle} contains resource files providing automation * resources. * * @param bundle is a {@link Bundle} object to check. * @return <tt>true</tt> if the specified {@link Bundle} contains resource files providing automation * resources, <tt>false</tt> otherwise. */ private boolean isAnAutomationProvider(Bundle bundle) { return bundle.getEntryPaths(AbstractResourceBundleProvider.ROOT_DIRECTORY) != null; }
public Enumeration<String> getEntryPaths(String path) { Bundle current = systemBundle; if (current == null) return null; return current.getEntryPaths(path); }
public Enumeration<String> getEntryPaths(String path) { Bundle current = systemBundle; if (current == null) return null; return current.getEntryPaths(path); }
public Enumeration<String> getEntryPaths(String path) { return m_bundle.getEntryPaths(path); }
public Bundle addingBundle(Bundle bundle, BundleEvent event) { if (bundle.getEntryPaths("static/") != null) return bundle; return null; } };
public Enumeration<String> getEntryPaths(String path) { return m_bundle.getEntryPaths(path); }
private boolean isBundle(Bundle bundle, String context) { if (bundle.getHeaders().get(context) != null) { return true; } return bundle.getEntryPaths(DEFAULT_COOS_CONTEXT) != null; }
@Override public boolean isDirectory() { //empty directories are not recognized String normalizedPath; if (path.charAt(path.length() - 1) != '/') { normalizedPath = path + "/"; } else { normalizedPath = path; } return bundle.getEntryPaths(normalizedPath) != null; }
private boolean isThemeBundle(Bundle bundle) { if ("com.vaadin".equals(bundle.getSymbolicName())) return false; Enumeration<?> vaadinPaths = bundle.getEntryPaths(org.opennms.vaadin.extender.Constants.VAADIN_PATH); if (vaadinPaths == null || !vaadinPaths.hasMoreElements()) return false; return true; }
private boolean isThemeBundle(Bundle bundle) { if ("com.vaadin".equals(bundle.getSymbolicName())) return false; Enumeration<?> vaadinPaths = bundle.getEntryPaths(org.opennms.vaadin.extender.Constants.VAADIN_PATH); if (vaadinPaths == null || !vaadinPaths.hasMoreElements()) return false; return true; }
@Override public String[] list() { List<String> resultList = new ArrayList<String>(); Enumeration<String> absPathEnum = bundle.getEntryPaths(path); if (absPathEnum != null) { final int pathLength = path.length(); while (absPathEnum.hasMoreElements()) { String absPath = absPathEnum.nextElement(); resultList.add(absPath.substring(pathLength)); } } return resultList.toArray(new String[resultList.size()]); }
private void extractContentDir(String pathPrefix, String path, File rootDir) throws IOException { File dir = new File(rootDir, path.substring(pathPrefix.length())); FileUtils.forceMkdir(dir); Enumeration<String> entryPaths = bundle.getEntryPaths(path); if (entryPaths != null) { while (entryPaths.hasMoreElements()) { extractContent(pathPrefix, entryPaths.nextElement(), bundleExtractDir); } } }
@Override public Set<String> getResourcePaths(String path) { Enumeration<?> paths = this.bundle.getEntryPaths(normalizePath(path)); if ((paths == null) || !paths.hasMoreElements()) { return null; } Set<String> set = new HashSet<>(); while (paths.hasMoreElements()) { set.add((String) paths.nextElement()); } return set; }
@Override public Set<String> getResourcePaths(String path) { Enumeration<?> paths = this.bundle.getEntryPaths(normalizePath(path)); if ((paths == null) || !paths.hasMoreElements()) { return null; } Set<String> set = new HashSet<>(); while (paths.hasMoreElements()) { set.add((String) paths.nextElement()); } return set; }
protected AbstractDeployable(ModuleType type, Bundle bundle, String rootDD) throws DDBeanCreateException { this.type = type; this.bundle = bundle; URL dd = bundle.getResource(rootDD); root = new DDBeanRootImpl(this, dd); entries = new ArrayList<String>(); Enumeration<String> paths = bundle.getEntryPaths("/"); //TODO WTF?? if statement seems to be required???? while (paths.hasMoreElements()) { String entry = paths.nextElement(); entries.add(entry); } }
public Collection<String> apply(String path) { Pair<Collection<String>,Collection<String>> entries = partition( Iterators.<String>forEnumeration(bundle.getEntryPaths(path)), new Predicate<String>() { public boolean apply(String s) { return s.endsWith("/"); }}); Collection<String> files = new ArrayList<String>(); files.addAll(entries._2); for (String folder : entries._1) files.addAll(apply(folder)); return files; }}; resources = new ImmutableList.Builder<URI>()