Interface EntrySource


public interface EntrySource
Provides access to a single file within an archive.
Since:
5.13
  • Method Details

    • apply

      <T> T apply(@Nonnull IoFunction<InputStream,T> reader) throws IOException
      Apply the IoFunction to the file represented by this entry and return the result.
      Type Parameters:
      T - type of the return value
      Parameters:
      reader - consumes the InputStream for this entry
      Returns:
      the value returned by reader
      Throws:
      IOException - if an error was encountered while performing IO
    • extractToDisk

      void extractToDisk(@Nonnull Path target) throws IOException
      Extract this entry to the specified target.
      Parameters:
      target - where this file will be copied
      Throws:
      IOException - if an error was encountered while performing IO
    • getPath

      @Nonnull Path getPath()
      Returns:
      location of this entry within the archive
    • read

      void read(@Nonnull IoConsumer<InputStream> reader) throws IOException
      Read the file represented by this entry.
      Parameters:
      reader - consumes the InputStream for this entry
      Throws:
      IOException - if an error was encountered while performing IO