Beispiel #1
0
  /**
   * Finds the named resource in one of the zip/jar files pointed at by this instance. This will
   * find the one in the earliest listed path element.
   *
   * @return a URL to the named resource or {@code null} if the resource is not found in any of the
   *     zip/jar files
   */
  public URL findResource(String name) {
    for (Element element : dexElements) {
      URL url = element.findResource(name);
      if (url != null) {
        return url;
      }
    }

    return null;
  }
Beispiel #2
0
  /**
   * Finds all the resources with the given name, returning an enumeration of them. If there are no
   * resources with the given name, then this method returns an empty enumeration.
   */
  public Enumeration<URL> findResources(String name) {
    ArrayList<URL> result = new ArrayList<URL>();

    for (Element element : dexElements) {
      URL url = element.findResource(name);
      if (url != null) {
        result.add(url);
      }
    }

    return Collections.enumeration(result);
  }