You are viewing the documentation for a prerelease version. View Latest

ARJ

Read-only: Compress4J can extract this format but cannot create it.

ARJ 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.

Unix symbolic link entries and entries whose data cannot be read (encrypted or using an unsupported method) fail 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

ARJ Extraction
try (ArjArchiveExtractor arjExtractor = ArjArchiveExtractor.builder(Path.of("example.arj"))
        .filter(entry -> !entry.name().startsWith("bad"))
        .overwrite(true)
        .build()) {
    arjExtractor.extract(Path.of("outputDir"));
}