UNIX dump
| Read-only: Compress4J can extract this format but cannot create it. |
UNIX dump support needs no extra dependency. The extractor writes directory and regular file entries and applies the same extraction guards as the other archive extractors: path traversal, symlink policy, and entry and size limits.
The unnamed root directory entry that every dump archive starts with is skipped, because it denotes the output directory itself.
Every other entry type (links, sockets, FIFOs, devices) fails with an IOException that the error handler receives; nothing is written for them.
Such entries are listed as regular files; the Unix file type bits of the entry’s mode show the real type, so a filter can detect them. If the target already exists and overwrite(false) is set, the entry is skipped before it is opened, so the error handler does not see it.
Example Usage
try (DumpArchiveExtractor dumpExtractor = DumpArchiveExtractor.builder(Path.of("example.dump"))
.filter(entry -> !entry.name().startsWith("bad"))
.overwrite(true)
.build()) {
dumpExtractor.extract(Path.of("outputDir"));
}
Want to help? Learn how to contribute to the Compress4J docs ›