Java 类sun.misc.CompoundEnumeration 实例源码

项目:spoofax-intellij    文件:PriorityURLClassLoader.java   
/**
 * {@inheritDoc}
 */
@Override
public Enumeration<URL> getResources(final String name) throws IOException {
    // Let's find us all resources.
    @SuppressWarnings("unchecked")
    final Enumeration<URL>[] resources = (Enumeration<URL>[]) new Enumeration<?>[2];

    // Instead of returning our parent's resources first,
    // we'll return our own resources first.
    resources[0] = findResources(name);
    resources[1] = this.parent.getResources(name);

    // TODO: Replace by our own implementation. It's simple!
    // First return all elements from the enumeration at index 0,
    // then all elements from the enumeration at index 1,
    // etc.. Or generalize to take an enumeration of enumerations
    // and flatten them?
    return new CompoundEnumeration<>(resources);
}
项目:tools-idea    文件:PluginClassLoader.java   
public Enumeration<URL> findResources(final String name) throws IOException {
  final long started = myDebugTime ? System.nanoTime() : 0;
  try {
    final Enumeration[] resources = new Enumeration[myParents.length + 1];
    resources[0] = super.findResources(name);
    for (int idx = 0; idx < myParents.length; idx++) {
      resources[idx + 1] = fetchResources(myParents[idx], name);
    }
    return new CompoundEnumeration<URL>(resources);
  }
  finally {
    long doneFor = myDebugTime ? System.nanoTime() - started:0;
    if (doneFor > NS_THRESHOLD) {
      System.out.println((doneFor / 1000000) + " ms for " + (myPluginId != null?myPluginId.getIdString():null)+ ", find resources:"+name);
    }
  }
}
项目:jboss-wildfly-remoting    文件:AluniteClassLoader.java   
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
protected Enumeration<URL> findResources(String name) throws IOException {
    Enumeration tmp[] = new Enumeration[delegates.length];
    for (int i = 0; i < tmp.length; i++)
        tmp[i] = delegates[i].getResources(name);
    return new CompoundEnumeration(tmp);
}
项目:intellij-ce-playground    文件:PluginClassLoader.java   
@Override
public Enumeration<URL> findResources(final String name) throws IOException {
  final Enumeration[] resources = new Enumeration[myParents.length + 1];
  resources[0] = super.findResources(name);
  for (int idx = 0; idx < myParents.length; idx++) {
    resources[idx + 1] = fetchResources(myParents[idx], name);
  }
  return new CompoundEnumeration<URL>(resources);
}
项目:jboss-wildfly-remoting    文件:AluniteClassLoader.java   
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
protected Enumeration<URL> findResources(String name) throws IOException {
    Enumeration tmp[] = new Enumeration[delegates.length];
    for (int i = 0; i < tmp.length; i++)
        tmp[i] = delegates[i].getResources(name);
    return new CompoundEnumeration(tmp);
}
项目:gjpf-core    文件:ClassLoader.java   
@SuppressWarnings({"unchecked","rawtypes"})
public Enumeration<URL> getResources(String name) throws IOException {
  Enumeration<URL>[] resEnum = new Enumeration[2];

  if(parent == null) {
    resEnum[0] = getSystemClassLoader().getResourcesURL(name);
  } else{
    resEnum[0] = parent.getResources(name);
  }
  resEnum[1] = findResources(name);

  return new CompoundEnumeration<URL>(resEnum);
}
项目:jpf-core    文件:ClassLoader.java   
@SuppressWarnings({"unchecked","rawtypes"})
public Enumeration<URL> getResources(String name) throws IOException {
  Enumeration<URL>[] resEnum = new Enumeration[2];

  if(parent == null) {
    resEnum[0] = getSystemClassLoader().getResourcesURL(name);
  } else{
    resEnum[0] = parent.getResources(name);
  }
  resEnum[1] = findResources(name);

  return new CompoundEnumeration<URL>(resEnum);
}
项目:jstorm    文件:WorkerClassLoader.java   
public Enumeration<URL> getResources(String name) throws IOException {
    Enumeration<URL>[] tmp = (Enumeration<URL>[]) new Enumeration<?>[2];
    tmp[0] = super.getResources(name);
    tmp[1] = defaultClassLoader.getResources(name);
    return new CompoundEnumeration<>(tmp);
}
项目:OpenJSharp    文件:ClassLoader.java   
/**
 * Finds all the resources with the given name. A resource is some data
 * (images, audio, text, etc) that can be accessed by class code in a way
 * that is independent of the location of the code.
 *
 * <p>The name of a resource is a <tt>/</tt>-separated path name that
 * identifies the resource.
 *
 * <p> The search order is described in the documentation for {@link
 * #getResource(String)}.  </p>
 *
 * @apiNote When overriding this method it is recommended that an
 * implementation ensures that any delegation is consistent with the {@link
 * #getResource(java.lang.String) getResource(String)} method. This should
 * ensure that the first element returned by the Enumeration's
 * {@code nextElement} method is the same resource that the
 * {@code getResource(String)} method would return.
 *
 * @param  name
 *         The resource name
 *
 * @return  An enumeration of {@link java.net.URL <tt>URL</tt>} objects for
 *          the resource.  If no resources could  be found, the enumeration
 *          will be empty.  Resources that the class loader doesn't have
 *          access to will not be in the enumeration.
 *
 * @throws  IOException
 *          If I/O errors occur
 *
 * @see  #findResources(String)
 *
 * @since  1.2
 */
public Enumeration<URL> getResources(String name) throws IOException {
    @SuppressWarnings("unchecked")
    Enumeration<URL>[] tmp = (Enumeration<URL>[]) new Enumeration<?>[2];
    if (parent != null) {
        tmp[0] = parent.getResources(name);
    } else {
        tmp[0] = getBootstrapResources(name);
    }
    tmp[1] = findResources(name);

    return new CompoundEnumeration<>(tmp);
}
项目:OpenJSharp    文件:ClassLoader.java   
/**
 * Finds all the resources with the given name. A resource is some data
 * (images, audio, text, etc) that can be accessed by class code in a way
 * that is independent of the location of the code.
 *
 * <p>The name of a resource is a <tt>/</tt>-separated path name that
 * identifies the resource.
 *
 * <p> The search order is described in the documentation for {@link
 * #getResource(String)}.  </p>
 *
 * @apiNote When overriding this method it is recommended that an
 * implementation ensures that any delegation is consistent with the {@link
 * #getResource(java.lang.String) getResource(String)} method. This should
 * ensure that the first element returned by the Enumeration's
 * {@code nextElement} method is the same resource that the
 * {@code getResource(String)} method would return.
 *
 * @param  name
 *         The resource name
 *
 * @return  An enumeration of {@link java.net.URL <tt>URL</tt>} objects for
 *          the resource.  If no resources could  be found, the enumeration
 *          will be empty.  Resources that the class loader doesn't have
 *          access to will not be in the enumeration.
 *
 * @throws  IOException
 *          If I/O errors occur
 *
 * @see  #findResources(String)
 *
 * @since  1.2
 */
public Enumeration<URL> getResources(String name) throws IOException {
    @SuppressWarnings("unchecked")
    Enumeration<URL>[] tmp = (Enumeration<URL>[]) new Enumeration<?>[2];
    if (parent != null) {
        tmp[0] = parent.getResources(name);
    } else {
        tmp[0] = getBootstrapResources(name);
    }
    tmp[1] = findResources(name);

    return new CompoundEnumeration<>(tmp);
}
项目:jdk8u-jdk    文件:ClassLoader.java   
/**
 * Finds all the resources with the given name. A resource is some data
 * (images, audio, text, etc) that can be accessed by class code in a way
 * that is independent of the location of the code.
 *
 * <p>The name of a resource is a <tt>/</tt>-separated path name that
 * identifies the resource.
 *
 * <p> The search order is described in the documentation for {@link
 * #getResource(String)}.  </p>
 *
 * @apiNote When overriding this method it is recommended that an
 * implementation ensures that any delegation is consistent with the {@link
 * #getResource(java.lang.String) getResource(String)} method. This should
 * ensure that the first element returned by the Enumeration's
 * {@code nextElement} method is the same resource that the
 * {@code getResource(String)} method would return.
 *
 * @param  name
 *         The resource name
 *
 * @return  An enumeration of {@link java.net.URL <tt>URL</tt>} objects for
 *          the resource.  If no resources could  be found, the enumeration
 *          will be empty.  Resources that the class loader doesn't have
 *          access to will not be in the enumeration.
 *
 * @throws  IOException
 *          If I/O errors occur
 *
 * @see  #findResources(String)
 *
 * @since  1.2
 */
public Enumeration<URL> getResources(String name) throws IOException {
    @SuppressWarnings("unchecked")
    Enumeration<URL>[] tmp = (Enumeration<URL>[]) new Enumeration<?>[2];
    if (parent != null) {
        tmp[0] = parent.getResources(name);
    } else {
        tmp[0] = getBootstrapResources(name);
    }
    tmp[1] = findResources(name);

    return new CompoundEnumeration<>(tmp);
}
项目:Java8CN    文件:ClassLoader.java   
/**
 * Finds all the resources with the given name. A resource is some data
 * (images, audio, text, etc) that can be accessed by class code in a way
 * that is independent of the location of the code.
 *
 * <p>The name of a resource is a <tt>/</tt>-separated path name that
 * identifies the resource.
 *
 * <p> The search order is described in the documentation for {@link
 * #getResource(String)}.  </p>
 *
 * @apiNote When overriding this method it is recommended that an
 * implementation ensures that any delegation is consistent with the {@link
 * #getResource(java.lang.String) getResource(String)} method. This should
 * ensure that the first element returned by the Enumeration's
 * {@code nextElement} method is the same resource that the
 * {@code getResource(String)} method would return.
 *
 * @param  name
 *         The resource name
 *
 * @return  An enumeration of {@link java.net.URL <tt>URL</tt>} objects for
 *          the resource.  If no resources could  be found, the enumeration
 *          will be empty.  Resources that the class loader doesn't have
 *          access to will not be in the enumeration.
 *
 * @throws  IOException
 *          If I/O errors occur
 *
 * @see  #findResources(String)
 *
 * @since  1.2
 */
public Enumeration<URL> getResources(String name) throws IOException {
    @SuppressWarnings("unchecked")
    Enumeration<URL>[] tmp = (Enumeration<URL>[]) new Enumeration<?>[2];
    if (parent != null) {
        tmp[0] = parent.getResources(name);
    } else {
        tmp[0] = getBootstrapResources(name);
    }
    tmp[1] = findResources(name);

    return new CompoundEnumeration<>(tmp);
}
项目:jdk8u_jdk    文件:ClassLoader.java   
/**
 * Finds all the resources with the given name. A resource is some data
 * (images, audio, text, etc) that can be accessed by class code in a way
 * that is independent of the location of the code.
 *
 * <p>The name of a resource is a <tt>/</tt>-separated path name that
 * identifies the resource.
 *
 * <p> The search order is described in the documentation for {@link
 * #getResource(String)}.  </p>
 *
 * @apiNote When overriding this method it is recommended that an
 * implementation ensures that any delegation is consistent with the {@link
 * #getResource(java.lang.String) getResource(String)} method. This should
 * ensure that the first element returned by the Enumeration's
 * {@code nextElement} method is the same resource that the
 * {@code getResource(String)} method would return.
 *
 * @param  name
 *         The resource name
 *
 * @return  An enumeration of {@link java.net.URL <tt>URL</tt>} objects for
 *          the resource.  If no resources could  be found, the enumeration
 *          will be empty.  Resources that the class loader doesn't have
 *          access to will not be in the enumeration.
 *
 * @throws  IOException
 *          If I/O errors occur
 *
 * @see  #findResources(String)
 *
 * @since  1.2
 */
public Enumeration<URL> getResources(String name) throws IOException {
    @SuppressWarnings("unchecked")
    Enumeration<URL>[] tmp = (Enumeration<URL>[]) new Enumeration<?>[2];
    if (parent != null) {
        tmp[0] = parent.getResources(name);
    } else {
        tmp[0] = getBootstrapResources(name);
    }
    tmp[1] = findResources(name);

    return new CompoundEnumeration<>(tmp);
}
项目:lookaside_java-1.8.0-openjdk    文件:ClassLoader.java   
/**
 * Finds all the resources with the given name. A resource is some data
 * (images, audio, text, etc) that can be accessed by class code in a way
 * that is independent of the location of the code.
 *
 * <p>The name of a resource is a <tt>/</tt>-separated path name that
 * identifies the resource.
 *
 * <p> The search order is described in the documentation for {@link
 * #getResource(String)}.  </p>
 *
 * @apiNote When overriding this method it is recommended that an
 * implementation ensures that any delegation is consistent with the {@link
 * #getResource(java.lang.String) getResource(String)} method. This should
 * ensure that the first element returned by the Enumeration's
 * {@code nextElement} method is the same resource that the
 * {@code getResource(String)} method would return.
 *
 * @param  name
 *         The resource name
 *
 * @return  An enumeration of {@link java.net.URL <tt>URL</tt>} objects for
 *          the resource.  If no resources could  be found, the enumeration
 *          will be empty.  Resources that the class loader doesn't have
 *          access to will not be in the enumeration.
 *
 * @throws  IOException
 *          If I/O errors occur
 *
 * @see  #findResources(String)
 *
 * @since  1.2
 */
public Enumeration<URL> getResources(String name) throws IOException {
    @SuppressWarnings("unchecked")
    Enumeration<URL>[] tmp = (Enumeration<URL>[]) new Enumeration<?>[2];
    if (parent != null) {
        tmp[0] = parent.getResources(name);
    } else {
        tmp[0] = getBootstrapResources(name);
    }
    tmp[1] = findResources(name);

    return new CompoundEnumeration<>(tmp);
}
项目:intellij-ce-playground    文件:aClassLoader.java   
/**
    * Finds all the resources with the given name. A resource is some data
    * (images, audio, text, etc) that can be accessed by class code in a way
    * that is independent of the location of the code.<p>
    *
    * The name of a resource is a "/"-separated path name that identifies the
    * resource.<p>
    *
    * The search order is described in the documentation for {@link
    * #getResource(String)}.<p>
    *
    * @param  name resource name
    * @return an enumeration of URL to the resource. If no resources could
    *         be found, the enumeration will be empty. Resources that the
    *         doesn't have access to will not be in the enumeration.
    * @throws IOException if I/O errors occur
    * @since  1.2
    * @see    #getResource
    * @see #findResources
    */
   public final Enumeration getResources(String name) throws IOException {
Enumeration[] tmp = new Enumeration[2];
if (parent != null) {
    tmp[0] = parent.getResources(name);
} else {
    tmp[0] = getBootstrapResources(name);
}
tmp[1] = findResources(name);

return new CompoundEnumeration(tmp);
   }
项目:VarJ    文件:ClassLoader.java   
/**
    * Finds all the resources with the given name. A resource is some data
    * (images, audio, text, etc) that can be accessed by class code in a way
    * that is independent of the location of the code.
    *
    * <p>The name of a resource is a <tt>/</tt>-separated path name that
    * identifies the resource.
    *
    * <p> The search order is described in the documentation for {@link
    * #getResource(String)}.  </p>
    *
    * @param  name
    *         The resource name
    *
    * @return  An enumeration of {@link java.net.URL <tt>URL</tt>} objects for
    *          the resource.  If no resources could  be found, the enumeration
    *          will be empty.  Resources that the class loader doesn't have
    *          access to will not be in the enumeration.
    *
    * @throws  IOException
    *          If I/O errors occur
    *
    * @see  #findResources(String)
    *
    * @since  1.2
    */
   public Enumeration<URL> getResources(String name) throws IOException {
Enumeration[] tmp = new Enumeration[2];
if (parent != null) {
    tmp[0] = parent.getResources(name);
} else {
    tmp[0] = getBootstrapResources(name);
}
tmp[1] = findResources(name);

return new CompoundEnumeration(tmp);
   }
项目:jdk-1.7-annotated    文件:ClassLoader.java   
/**
 * Finds all the resources with the given name. A resource is some data
 * (images, audio, text, etc) that can be accessed by class code in a way
 * that is independent of the location of the code.
 *
 * <p>The name of a resource is a <tt>/</tt>-separated path name that
 * identifies the resource.
 *
 * <p> The search order is described in the documentation for {@link
 * #getResource(String)}.  </p>
 *
 * @param  name
 *         The resource name
 *
 * @return  An enumeration of {@link java.net.URL <tt>URL</tt>} objects for
 *          the resource.  If no resources could  be found, the enumeration
 *          will be empty.  Resources that the class loader doesn't have
 *          access to will not be in the enumeration.
 *
 * @throws  IOException
 *          If I/O errors occur
 *
 * @see  #findResources(String)
 *
 * @since  1.2
 */
public Enumeration<URL> getResources(String name) throws IOException {
    Enumeration[] tmp = new Enumeration[2];
    if (parent != null) {
        tmp[0] = parent.getResources(name);
    } else {
        tmp[0] = getBootstrapResources(name);
    }
    tmp[1] = findResources(name);

    return new CompoundEnumeration<>(tmp);
}
项目:infobip-open-jdk-8    文件:ClassLoader.java   
/**
 * Finds all the resources with the given name. A resource is some data
 * (images, audio, text, etc) that can be accessed by class code in a way
 * that is independent of the location of the code.
 *
 * <p>The name of a resource is a <tt>/</tt>-separated path name that
 * identifies the resource.
 *
 * <p> The search order is described in the documentation for {@link
 * #getResource(String)}.  </p>
 *
 * @apiNote When overriding this method it is recommended that an
 * implementation ensures that any delegation is consistent with the {@link
 * #getResource(java.lang.String) getResource(String)} method. This should
 * ensure that the first element returned by the Enumeration's
 * {@code nextElement} method is the same resource that the
 * {@code getResource(String)} method would return.
 *
 * @param  name
 *         The resource name
 *
 * @return  An enumeration of {@link java.net.URL <tt>URL</tt>} objects for
 *          the resource.  If no resources could  be found, the enumeration
 *          will be empty.  Resources that the class loader doesn't have
 *          access to will not be in the enumeration.
 *
 * @throws  IOException
 *          If I/O errors occur
 *
 * @see  #findResources(String)
 *
 * @since  1.2
 */
public Enumeration<URL> getResources(String name) throws IOException {
    @SuppressWarnings("unchecked")
    Enumeration<URL>[] tmp = (Enumeration<URL>[]) new Enumeration<?>[2];
    if (parent != null) {
        tmp[0] = parent.getResources(name);
    } else {
        tmp[0] = getBootstrapResources(name);
    }
    tmp[1] = findResources(name);

    return new CompoundEnumeration<>(tmp);
}
项目:jdk8u-dev-jdk    文件:ClassLoader.java   
/**
 * Finds all the resources with the given name. A resource is some data
 * (images, audio, text, etc) that can be accessed by class code in a way
 * that is independent of the location of the code.
 *
 * <p>The name of a resource is a <tt>/</tt>-separated path name that
 * identifies the resource.
 *
 * <p> The search order is described in the documentation for {@link
 * #getResource(String)}.  </p>
 *
 * @apiNote When overriding this method it is recommended that an
 * implementation ensures that any delegation is consistent with the {@link
 * #getResource(java.lang.String) getResource(String)} method. This should
 * ensure that the first element returned by the Enumeration's
 * {@code nextElement} method is the same resource that the
 * {@code getResource(String)} method would return.
 *
 * @param  name
 *         The resource name
 *
 * @return  An enumeration of {@link java.net.URL <tt>URL</tt>} objects for
 *          the resource.  If no resources could  be found, the enumeration
 *          will be empty.  Resources that the class loader doesn't have
 *          access to will not be in the enumeration.
 *
 * @throws  IOException
 *          If I/O errors occur
 *
 * @see  #findResources(String)
 *
 * @since  1.2
 */
public Enumeration<URL> getResources(String name) throws IOException {
    @SuppressWarnings("unchecked")
    Enumeration<URL>[] tmp = (Enumeration<URL>[]) new Enumeration<?>[2];
    if (parent != null) {
        tmp[0] = parent.getResources(name);
    } else {
        tmp[0] = getBootstrapResources(name);
    }
    tmp[1] = findResources(name);

    return new CompoundEnumeration<>(tmp);
}
项目:jdk7-jdk    文件:ClassLoader.java   
/**
 * Finds all the resources with the given name. A resource is some data
 * (images, audio, text, etc) that can be accessed by class code in a way
 * that is independent of the location of the code.
 *
 * <p>The name of a resource is a <tt>/</tt>-separated path name that
 * identifies the resource.
 *
 * <p> The search order is described in the documentation for {@link
 * #getResource(String)}.  </p>
 *
 * @param  name
 *         The resource name
 *
 * @return  An enumeration of {@link java.net.URL <tt>URL</tt>} objects for
 *          the resource.  If no resources could  be found, the enumeration
 *          will be empty.  Resources that the class loader doesn't have
 *          access to will not be in the enumeration.
 *
 * @throws  IOException
 *          If I/O errors occur
 *
 * @see  #findResources(String)
 *
 * @since  1.2
 */
public Enumeration<URL> getResources(String name) throws IOException {
    Enumeration[] tmp = new Enumeration[2];
    if (parent != null) {
        tmp[0] = parent.getResources(name);
    } else {
        tmp[0] = getBootstrapResources(name);
    }
    tmp[1] = findResources(name);

    return new CompoundEnumeration<>(tmp);
}
项目:openjdk-source-code-learn    文件:ClassLoader.java   
/**
 * Finds all the resources with the given name. A resource is some data
 * (images, audio, text, etc) that can be accessed by class code in a way
 * that is independent of the location of the code.
 *
 * <p>The name of a resource is a <tt>/</tt>-separated path name that
 * identifies the resource.
 *
 * <p> The search order is described in the documentation for {@link
 * #getResource(String)}.  </p>
 *
 * @param  name
 *         The resource name
 *
 * @return  An enumeration of {@link java.net.URL <tt>URL</tt>} objects for
 *          the resource.  If no resources could  be found, the enumeration
 *          will be empty.  Resources that the class loader doesn't have
 *          access to will not be in the enumeration.
 *
 * @throws  IOException
 *          If I/O errors occur
 *
 * @see  #findResources(String)
 *
 * @since  1.2
 */
public Enumeration<URL> getResources(String name) throws IOException {
    Enumeration[] tmp = new Enumeration[2];
    if (parent != null) {
        tmp[0] = parent.getResources(name);
    } else {
        tmp[0] = getBootstrapResources(name);
    }
    tmp[1] = findResources(name);

    return new CompoundEnumeration<>(tmp);
}
项目:OLD-OpenJDK8    文件:ClassLoader.java   
/**
 * Finds all the resources with the given name. A resource is some data
 * (images, audio, text, etc) that can be accessed by class code in a way
 * that is independent of the location of the code.
 *
 * <p>The name of a resource is a <tt>/</tt>-separated path name that
 * identifies the resource.
 *
 * <p> The search order is described in the documentation for {@link
 * #getResource(String)}.  </p>
 *
 * @apiNote When overriding this method it is recommended that an
 * implementation ensures that any delegation is consistent with the {@link
 * #getResource(java.lang.String) getResource(String)} method. This should
 * ensure that the first element returned by the Enumeration's
 * {@code nextElement} method is the same resource that the
 * {@code getResource(String)} method would return.
 *
 * @param  name
 *         The resource name
 *
 * @return  An enumeration of {@link java.net.URL <tt>URL</tt>} objects for
 *          the resource.  If no resources could  be found, the enumeration
 *          will be empty.  Resources that the class loader doesn't have
 *          access to will not be in the enumeration.
 *
 * @throws  IOException
 *          If I/O errors occur
 *
 * @see  #findResources(String)
 *
 * @since  1.2
 */
public Enumeration<URL> getResources(String name) throws IOException {
    @SuppressWarnings("unchecked")
    Enumeration<URL>[] tmp = (Enumeration<URL>[]) new Enumeration<?>[2];
    if (parent != null) {
        tmp[0] = parent.getResources(name);
    } else {
        tmp[0] = getBootstrapResources(name);
    }
    tmp[1] = findResources(name);

    return new CompoundEnumeration<>(tmp);
}
项目:tools-idea    文件:aClassLoader.java   
/**
    * Finds all the resources with the given name. A resource is some data
    * (images, audio, text, etc) that can be accessed by class code in a way
    * that is independent of the location of the code.<p>
    *
    * The name of a resource is a "/"-separated path name that identifies the
    * resource.<p>
    *
    * The search order is described in the documentation for {@link
    * #getResource(String)}.<p>
    *
    * @param  name resource name
    * @return an enumeration of URL to the resource. If no resources could
    *         be found, the enumeration will be empty. Resources that the
    *         doesn't have access to will not be in the enumeration.
    * @throws IOException if I/O errors occur
    * @since  1.2
    * @see    #getResource
    * @see #findResources
    */
   public final Enumeration getResources(String name) throws IOException {
Enumeration[] tmp = new Enumeration[2];
if (parent != null) {
    tmp[0] = parent.getResources(name);
} else {
    tmp[0] = getBootstrapResources(name);
}
tmp[1] = findResources(name);

return new CompoundEnumeration(tmp);
   }
项目:openjdk-jdk7u-jdk    文件:ClassLoader.java   
/**
 * Finds all the resources with the given name. A resource is some data
 * (images, audio, text, etc) that can be accessed by class code in a way
 * that is independent of the location of the code.
 *
 * <p>The name of a resource is a <tt>/</tt>-separated path name that
 * identifies the resource.
 *
 * <p> The search order is described in the documentation for {@link
 * #getResource(String)}.  </p>
 *
 * @param  name
 *         The resource name
 *
 * @return  An enumeration of {@link java.net.URL <tt>URL</tt>} objects for
 *          the resource.  If no resources could  be found, the enumeration
 *          will be empty.  Resources that the class loader doesn't have
 *          access to will not be in the enumeration.
 *
 * @throws  IOException
 *          If I/O errors occur
 *
 * @see  #findResources(String)
 *
 * @since  1.2
 */
public Enumeration<URL> getResources(String name) throws IOException {
    Enumeration[] tmp = new Enumeration[2];
    if (parent != null) {
        tmp[0] = parent.getResources(name);
    } else {
        tmp[0] = getBootstrapResources(name);
    }
    tmp[1] = findResources(name);

    return new CompoundEnumeration<>(tmp);
}
项目:openjdk-icedtea7    文件:ClassLoader.java   
/**
 * Finds all the resources with the given name. A resource is some data
 * (images, audio, text, etc) that can be accessed by class code in a way
 * that is independent of the location of the code.
 *
 * <p>The name of a resource is a <tt>/</tt>-separated path name that
 * identifies the resource.
 *
 * <p> The search order is described in the documentation for {@link
 * #getResource(String)}.  </p>
 *
 * @param  name
 *         The resource name
 *
 * @return  An enumeration of {@link java.net.URL <tt>URL</tt>} objects for
 *          the resource.  If no resources could  be found, the enumeration
 *          will be empty.  Resources that the class loader doesn't have
 *          access to will not be in the enumeration.
 *
 * @throws  IOException
 *          If I/O errors occur
 *
 * @see  #findResources(String)
 *
 * @since  1.2
 */
public Enumeration<URL> getResources(String name) throws IOException {
    Enumeration[] tmp = new Enumeration[2];
    if (parent != null) {
        tmp[0] = parent.getResources(name);
    } else {
        tmp[0] = getBootstrapResources(name);
    }
    tmp[1] = findResources(name);

    return new CompoundEnumeration<>(tmp);
}
项目:consulo-java    文件:aClassLoader.java   
/**
    * Finds all the resources with the given name. A resource is some data
    * (images, audio, text, etc) that can be accessed by class code in a way
    * that is independent of the location of the code.<p>
    *
    * The name of a resource is a "/"-separated path name that identifies the
    * resource.<p>
    *
    * The search order is described in the documentation for {@link
    * #getResource(String)}.<p>
    *
    * @param  name resource name
    * @return an enumeration of URL to the resource. If no resources could
    *         be found, the enumeration will be empty. Resources that the
    *         doesn't have access to will not be in the enumeration.
    * @throws IOException if I/O errors occur
    * @since  1.2
    * @see    #getResource
    * @see #findResources
    */
   public final Enumeration getResources(String name) throws IOException {
Enumeration[] tmp = new Enumeration[2];
if (parent != null) {
    tmp[0] = parent.getResources(name);
} else {
    tmp[0] = getBootstrapResources(name);
}
tmp[1] = findResources(name);

return new CompoundEnumeration(tmp);
   }
项目:intellij-ce-playground    文件:aClassLoader.java   
/**
    * Returns an Enumeration of URLs representing all the resources with
    * the given name. Class loader implementations should override this
    * method to specify where to load resources from.
    *
    * @param  name the resource name
    * @return an Enumeration of URLs for the resources
    * @throws IOException if I/O errors occur
    * @since  1.2
    */
   protected Enumeration findResources(String name) throws IOException {
return new CompoundEnumeration(new Enumeration[0]);
   }
项目:VarJ    文件:ClassLoader.java   
/**
    * Returns an enumeration of {@link java.net.URL <tt>URL</tt>} objects
    * representing all the resources with the given name. Class loader
    * implementations should override this method to specify where to load
    * resources from.  </p>
    *
    * @param  name
    *         The resource name
    *
    * @return  An enumeration of {@link java.net.URL <tt>URL</tt>} objects for
    *          the resources
    *
    * @throws  IOException
    *          If I/O errors occur
    *
    * @since  1.2
    */
   protected Enumeration<URL> findResources(String name) throws IOException {
return new CompoundEnumeration(new Enumeration[0]);
   }
项目:tools-idea    文件:aClassLoader.java   
/**
    * Returns an Enumeration of URLs representing all the resources with
    * the given name. Class loader implementations should override this
    * method to specify where to load resources from.
    *
    * @param  name the resource name
    * @return an Enumeration of URLs for the resources
    * @throws IOException if I/O errors occur
    * @since  1.2
    */
   protected Enumeration findResources(String name) throws IOException {
return new CompoundEnumeration(new Enumeration[0]);
   }
项目:consulo-java    文件:aClassLoader.java   
/**
    * Returns an Enumeration of URLs representing all the resources with
    * the given name. Class loader implementations should override this
    * method to specify where to load resources from.
    *
    * @param  name the resource name
    * @return an Enumeration of URLs for the resources
    * @throws IOException if I/O errors occur
    * @since  1.2
    */
   protected Enumeration findResources(String name) throws IOException {
return new CompoundEnumeration(new Enumeration[0]);
   }