Java Code Examples for java.util.Collections#emptyEnumeration()
The following examples show how to use
java.util.Collections#emptyEnumeration() .
These examples are extracted from open source projects.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: Bytecoder File: JarFile.java License: Apache License 2.0 | 6 votes |
Enumeration<String> entryNames(CodeSource[] cs) { ensureInitialization(); if (jv != null) { return jv.entryNames(this, cs); } /* * JAR file has no signed content. Is there a non-signing * code source? */ boolean includeUnsigned = false; for (CodeSource c : cs) { if (c.getCodeSigners() == null) { includeUnsigned = true; break; } } if (includeUnsigned) { return unsignedEntryNames(); } else { return Collections.emptyEnumeration(); } }
Example 2
Source Project: quarkus File: VertxHttpRequest.java License: Apache License 2.0 | 6 votes |
@Override public Enumeration<String> getAttributeNames() { final Map<String, Object> attributes = routingContext.data(); if (attributes == null) { return Collections.emptyEnumeration(); } else { Enumeration<String> en = new Enumeration<String>() { private Iterator<String> it = attributes.keySet().iterator(); @Override public boolean hasMoreElements() { return it.hasNext(); } @Override public String nextElement() { return it.next(); } }; return en; } }
Example 3
Source Project: netbeans File: SourceFS.java License: Apache License 2.0 | 5 votes |
@Override public Enumeration<String> attributes(String name) { Item item = getItem(name); if (item != null) { return item.getAttributes(); } else { return Collections.emptyEnumeration(); } }
Example 4
Source Project: Bytecoder File: BuiltinClassLoader.java License: Apache License 2.0 | 5 votes |
/** * Returns the URLs of all resources of the given name on the class path. */ private Enumeration<URL> findResourcesOnClassPath(String name) { if (hasClassPath()) { if (System.getSecurityManager() == null) { return ucp.findResources(name, false); } else { PrivilegedAction<Enumeration<URL>> pa; pa = () -> ucp.findResources(name, false); return AccessController.doPrivileged(pa); } } else { // no class path return Collections.emptyEnumeration(); } }
Example 5
Source Project: data-prep File: HttpRequestContext.java License: Apache License 2.0 | 5 votes |
public static Enumeration<String> parameters() { final RequestAttributes attributes = RequestContextHolder.getRequestAttributes(); if (attributes != null && attributes instanceof ServletRequestAttributes) { return ((ServletRequestAttributes) attributes).getRequest().getParameterNames(); } return Collections.emptyEnumeration(); }
Example 6
Source Project: java-specialagent File: PluginsClassLoader.java License: Apache License 2.0 | 5 votes |
/** * Creates a new {@code PluginsClassLoader} with the specified set of files * providing the JAR paths. * * @param files The {@code File} objects providing the JAR paths. */ public PluginsClassLoader(final Set<File> files) { // Override parent ClassLoader methods to avoid delegation of resource // resolution to bootstrap class loader super(AssembleUtil.toURLs(files), new ClassLoader(null) { // Overridden to ensure resources are not discovered in bootstrap class loader @Override public Enumeration<URL> getResources(final String name) throws IOException { return Collections.<URL>emptyEnumeration(); } }); this.set = files; this.array = files.toArray(new File[files.size()]); }
Example 7
Source Project: netbeans File: NbRemoteLoader.java License: Apache License 2.0 | 5 votes |
@Override public Enumeration<URL> findResources(String name) throws IOException { Enumeration<URL> origResources = getParent().getResources(name); Enumeration<URL> deleResources = oldDelegate != null ? oldDelegate.findResources(name) : Collections.<URL>emptyEnumeration(); return new CompoundEnumeration<URL>(new Enumeration[] { origResources, deleResources, super.findResources(name) }); }
Example 8
Source Project: thorntail File: ExtensionPreventionClassLoaderWrapper.java License: Apache License 2.0 | 5 votes |
@Override public Enumeration<URL> getResources(String name) throws IOException { if (name.equals(EXTENSION)) { return Collections.emptyEnumeration(); } return super.getResources(name); }
Example 9
Source Project: jdk8u-dev-jdk File: SimpleAttributeSet.java License: GNU General Public License v2.0 | 4 votes |
public Enumeration getAttributeNames() { return Collections.emptyEnumeration(); }
Example 10
Source Project: deprecated-security-advanced-modules File: MockSamlIdpServer.java License: Apache License 2.0 | 4 votes |
@SuppressWarnings("rawtypes") @Override public Enumeration getAttributeNames() { return Collections.emptyEnumeration(); }
Example 11
Source Project: jdk8u-jdk File: SimpleAttributeSet.java License: GNU General Public License v2.0 | 4 votes |
public Enumeration getAttributeNames() { return Collections.emptyEnumeration(); }
Example 12
Source Project: jdk8u_jdk File: SimpleAttributeSet.java License: GNU General Public License v2.0 | 4 votes |
public Enumeration getAttributeNames() { return Collections.emptyEnumeration(); }
Example 13
Source Project: spring-boot-starter-netty File: AbstractNettyRegistration.java License: Apache License 2.0 | 4 votes |
@Override public Enumeration<String> getInitParameterNames() { return Collections.emptyEnumeration(); }
Example 14
Source Project: datacollector File: SDCClassLoader.java License: Apache License 2.0 | 4 votes |
@Override public Enumeration<URL> getResources(String name) throws IOException { if (debug) { System.err.println("getResources(" + name + ")"); } Enumeration<URL> result = null; if (!systemPackage.isSystem(name)) { // Search local repositories if (debug) { System.err.println(" Searching local repositories"); } result = findResources(name); if (result != null && result.hasMoreElements()) { if (debug) { System.err.println(" --> Returning result from local"); } return result; } if (applicationPackage.isApplication(name)) { if (debug) { System.err.println(" --> application class, returning empty enumeration"); } return Collections.emptyEnumeration(); } } // Delegate to parent unconditionally if (debug) { System.err.println(" Delegating to parent classloader unconditionally " + parent); } result = parent.getResources(name); if (result != null && result.hasMoreElements()) { if (debug) { List<URL> resultList = Collections.list(result); result = Collections.enumeration(resultList); System.err.println(" --> Returning result from parent: " + resultList); } return result; } // (4) Resource was not found if (debug) { System.err.println(" --> Resource not found, returning empty enumeration"); } return Collections.emptyEnumeration(); }
Example 15
Source Project: dragonwell8_jdk File: SimpleAttributeSet.java License: GNU General Public License v2.0 | 4 votes |
public Enumeration getAttributeNames() { return Collections.emptyEnumeration(); }
Example 16
Source Project: hottub File: SimpleAttributeSet.java License: GNU General Public License v2.0 | 4 votes |
public Enumeration getAttributeNames() { return Collections.emptyEnumeration(); }
Example 17
Source Project: vespa File: MockBundle.java License: Apache License 2.0 | 4 votes |
@Override public Enumeration<URL> findEntries(String path, String filePattern, boolean recurse) { return Collections.emptyEnumeration(); }
Example 18
Source Project: Jinx File: AbstractNettyRegistration.java License: Apache License 2.0 | 4 votes |
@Override public Enumeration<String> getInitParameterNames() { return Collections.emptyEnumeration(); }
Example 19
Source Project: openjdk-jdk9 File: SimpleAttributeSet.java License: GNU General Public License v2.0 | 4 votes |
public Enumeration<?> getAttributeNames() { return Collections.emptyEnumeration(); }
Example 20
Source Project: Bytecoder File: ClassLoader.java License: Apache License 2.0 | 2 votes |
/** * Returns an enumeration of {@link java.net.URL URL} objects * representing all the resources with the given name. Class loader * implementations should override this method. * * <p> For resources in named modules then the method must implement the * rules for encapsulation specified in the {@code Module} {@link * Module#getResourceAsStream getResourceAsStream} method. Additionally, * it must not find non-"{@code .class}" resources in packages of named * modules unless the package is {@link Module#isOpen(String) opened} * unconditionally. </p> * * @implSpec The default implementation returns an enumeration that * contains no elements. * * @param name * The resource name * * @return An enumeration of {@link java.net.URL URL} objects for * the resource. If no resources could be found, the enumeration * will be empty. Resources for which a {@code URL} cannot be * constructed, are in a package that is not opened unconditionally, * or access to the resource is denied by the security manager, * are not returned in the enumeration. * * @throws IOException * If I/O errors occur * * @since 1.2 * @revised 9 * @spec JPMS */ protected Enumeration<URL> findResources(String name) throws IOException { return Collections.emptyEnumeration(); }