Interface ArchiveSource
public interface ArchiveSource
Provides access to an archive within an archive.
- Since:
- 5.13
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidextractToDisk(Path target) Extract this contents of this archive to the specified target.voidextractToDisk(Path target, Predicate<String> filter) Filter and extract this contents of this archive to the specified target.getPath()Get the path of this archive source.default voidread(IoConsumer<EntrySource> reader) Filter and read each file in the archive.voidread(IoConsumer<EntrySource> reader, Predicate<String> filter) Filter and read each file in the archive.
-
Method Details
-
extractToDisk
Filter and extract this contents of this archive to the specified target.- Parameters:
target- path on disk where files will be extractedfilter- predicate applied to each file before extraction. If the predicate returnsfalsethe file will not be extracted- Throws:
IOException- if an error was encountered while performing IO
-
extractToDisk
Extract this contents of this archive to the specified target.- Parameters:
target- path on disk where files will be extracted- Throws:
IOException- if an error was encountered while performing IO
-
getPath
Get the path of this archive source.- Returns:
- the path of this archive source
-
read
Filter and read each file in the archive.- Parameters:
reader- used to read the contents of each file- Throws:
IOException- if an error was encountered while performing IO
-
read
void read(@Nonnull IoConsumer<EntrySource> reader, @Nonnull Predicate<String> filter) throws IOException Filter and read each file in the archive.- Parameters:
reader- used to read the contents of each filefilter- predicate applied to each file before reading. If the predicate returnsfalsethe file will not be extracted- Throws:
IOException- if an error was encountered while performing IO
-