Package iu.type

Class PathEntryScanner

java.lang.Object
iu.type.PathEntryScanner

class PathEntryScanner extends Object
Scans a path entry: either a jar file or filesystem directory, for non-folder resources.
  • Method Details

    • read

      static byte[] read(Path pathEntry, String resourceName) throws IOException
      Reads a single path entry.

      This method is not efficient for multiple reads.

      Parameters:
      pathEntry - path entry: jar file or filesystem directory
      resourceName - resource name
      Returns:
      full binary contents of the resource
      Throws:
      IOException - if an error occurs while reading the file
      NoSuchFileException - if the resourceName doesn't match an entry in the jar file, or doesn't name a filesystem resource relative to pathEntry.
    • findResources

      static Set<String> findResources(Path pathEntry) throws IOException
      Scans a path entry.
      Parameters:
      pathEntry - path entry: jar file or filesystem directory, to scan
      Returns:
      mutable set initialized with all discovered resource names; may be modified after return
      Throws:
      IOException - if an I/O error occurs scanning the path entry