Interface EntrySource
public interface EntrySource
Provides access to a single file within an archive.
- Since:
- 5.13
-
Method Summary
Modifier and TypeMethodDescription<T> T
apply
(IoFunction<InputStream, T> reader) Apply theIoFunction
to the file represented by this entry and return the result.void
extractToDisk
(Path target) Extract this entry to the specified target.getPath()
void
read
(IoConsumer<InputStream> reader) Read the file represented by this entry.
-
Method Details
-
apply
Apply theIoFunction
to the file represented by this entry and return the result.- Type Parameters:
T
- type of the return value- Parameters:
reader
- consumes theInputStream
for this entry- Returns:
- the value returned by
reader
- Throws:
IOException
- if an error was encountered while performing IO
-
extractToDisk
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
- Returns:
- location of this entry within the archive
-
read
Read the file represented by this entry.- Parameters:
reader
- consumes theInputStream
for this entry- Throws:
IOException
- if an error was encountered while performing IO
-