MultiReadOnlySeekableByteChannel that knows what a split ZIP archive should look like.
If you want to read a split archive using ZipFile then create an instance of this class from the parts of the archive.
| Modifier and Type | Class and Description |
|---|---|
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private static final Path[] | |
| private static final int | |
| private final ByteBuffer |
| Access | Constructor and Description |
|---|---|
| public | ZipSplitReadOnlySeekableByteChannel(final List<SeekableByteChannel>
the channels to concatenate channels)Concatenates the given channels. |
| Modifier and Type | Method and Description |
|---|---|
| private void | assertSplitSignature(final List<SeekableByteChannel>
channels to be validated channels)Based on the ZIP specification: 8.5.3 Spanned/Split archives created using PKZIP for Windows (V2.50 or greater), PKZIP Command Line (V2.50 or greater), or PKZIP Explorer will include a special spanning signature as the first 4 bytes of the first segment of the archive. |
| public static SeekableByteChannel | Returns: SeekableByteChannel that concatenates all ZIP split filesthe last segment of ZIP split files, note that the extension SHOULD be .zip lastSegmentFile)Concatenates ZIP split files from the last segment(the extension SHOULD be .zip) |
| public static SeekableByteChannel | Returns: SeekableByteChannel that concatenates all ZIP split filesthe last segment of ZIP split files, note that the extension MUST be .zip lastSegmentPath)Concatenates ZIP split files from the last segment (the extension MUST be .zip) |
| public static SeekableByteChannel | Returns: SeekableByteChannel that concatenates all provided filesthe files to concatenate, note that the LAST FILE of files should be the LAST SEGMENT(.zip) and these files should be added in correct order
(e.g. .z01, .z02... .z99, .zip) files)Hides org. |
| public static SeekableByteChannel | Returns: SeekableByteChannel that concatenates all provided filesthe last segment of split ZIP segments, its extension should be .zip lastSegmentFile, final Iterable<File> the files to concatenate except for the last segment, note these files should be added in correct order (e.g. .z01, .z02... .z99) files)Concatenates the given files. |
| public static SeekableByteChannel | Returns: SeekableByteChannel that concatenates all provided channelsthe channels to concatenate, note that the LAST CHANNEL of channels should be the LAST SEGMENT(.zip) and these channels should be added
in correct order (e.g. .z01, .z02... .z99, .zip) channels)Concatenates the given channels. |
| public static SeekableByteChannel | Returns: SeekableByteChannel that concatenates all provided channelschannel of the last segment of split ZIP segments, its extension should be .zip lastSegmentChannel, final Iterable<SeekableByteChannel> the channels to concatenate except for the last segment, note these channels should be added in correct order (e.g. .z01,
.z02... .z99) channels)Concatenates the given channels. |
| public static SeekableByteChannel | Returns: SeekableByteChannel that concatenates all provided filesthe file paths to concatenate, note that the LAST FILE of files should be the LAST SEGMENT(.zip) and these files should be added in correct
order (e.g.: .z01, .z02... .z99, .zip) paths, final OpenOption[] the options to open paths (shared by all paths). openOptions)Concatenates the given file paths. |
| public static SeekableByteChannel | Returns: SeekableByteChannel that concatenates all provided filesthe file paths to concatenate, note that the LAST FILE of files should be the LAST SEGMENT(.zip) and these files should be added in correct
order (e.g.: .z01, .z02... .z99, .zip) paths)Hides org. |
| public static SeekableByteChannel | Returns: SeekableByteChannel that concatenates all provided filesthe last segment path of split ZIP segments, its extension must be .zip lastSegmentPath, final Iterable<Path> the file paths to concatenate except for the last segment, note these files should be added in correct order (e.g.: .z01, .z02...
.z99) paths)Concatenates the given file paths. |
| EMPTY_PATH_ARRAY | back to summary |
|---|---|
| private static final Path[] EMPTY_PATH_ARRAY Hides org. | |
| ZIP_SPLIT_SIGNATURE_LENGTH | back to summary |
|---|---|
| private static final int ZIP_SPLIT_SIGNATURE_LENGTH | |
| zipSplitSignatureByteBuffer | back to summary |
|---|---|
| private final ByteBuffer zipSplitSignatureByteBuffer | |
| ZipSplitReadOnlySeekableByteChannel | back to summary |
|---|---|
| public ZipSplitReadOnlySeekableByteChannel(final List<SeekableByteChannel> channels) throws IOException Concatenates the given channels. The channels should be add in ascending order, e.g. z01, z02, ... z99, ZIP please note that the .zip file is the last segment and should be added as the last one in the channels
| |
| assertSplitSignature | back to summary |
|---|---|
| private void assertSplitSignature(final List<SeekableByteChannel> channels) throws IOException Based on the ZIP specification: 8.5.3 Spanned/Split archives created using PKZIP for Windows (V2.50 or greater), PKZIP Command Line (V2.50 or greater), or PKZIP Explorer will include a special spanning signature as the first 4 bytes of the first segment of the archive. This signature (0x08074b50) will be followed immediately by the local header signature for the first file in the archive. The first 4 bytes of the first ZIP split segment should be the ZIP split signature(0x08074B50)
| |
| buildFromLastSplitSegment | back to summary |
|---|---|
| public static SeekableByteChannel buildFromLastSplitSegment(final File lastSegmentFile) throws IOException Concatenates ZIP split files from the last segment(the extension SHOULD be .zip)
| |
| buildFromLastSplitSegment | back to summary |
|---|---|
| public static SeekableByteChannel buildFromLastSplitSegment(final Path lastSegmentPath) throws IOException Concatenates ZIP split files from the last segment (the extension MUST be .zip)
| |
| forFiles | back to summary |
|---|---|
| public static SeekableByteChannel forFiles(final File... files) throws IOException Hides org. Concatenates the given files.
| |
| forFiles | back to summary |
|---|---|
| public static SeekableByteChannel forFiles(final File lastSegmentFile, final Iterable<File> files) throws IOException Concatenates the given files.
| |
| forOrderedSeekableByteChannels | back to summary |
|---|---|
| public static SeekableByteChannel forOrderedSeekableByteChannels(final SeekableByteChannel... channels) throws IOException Concatenates the given channels.
| |
| forOrderedSeekableByteChannels | back to summary |
|---|---|
| public static SeekableByteChannel forOrderedSeekableByteChannels(final SeekableByteChannel lastSegmentChannel, final Iterable<SeekableByteChannel> channels) throws IOException Concatenates the given channels.
| |
| forPaths | back to summary |
|---|---|
| public static SeekableByteChannel forPaths(final List<Path> paths, final OpenOption[] openOptions) throws IOException Concatenates the given file paths.
| |
| forPaths | back to summary |
|---|---|
| public static SeekableByteChannel forPaths(final Path... paths) throws IOException Hides org. Concatenates the given file paths.
| |
| forPaths | back to summary |
|---|---|
| public static SeekableByteChannel forPaths(final Path lastSegmentPath, final Iterable<Path> paths) throws IOException Concatenates the given file paths.
| |
| Modifier and Type | Field and Description |
|---|---|
| private static final long |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public int | compare(final Path
the first object to be compared. file1, final Path the second object to be compared. file2)Implements java. |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| ZipSplitSegmentComparator | back to summary |
|---|---|
| private ZipSplitSegmentComparator() | |
| compare | back to summary |
|---|---|
| public int compare(final Path file1, final Path file2) Implements java. Doc from java. Compares its two arguments for order. Returns a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.
The implementor must ensure that
The implementor must also ensure that the relation is transitive:
Finally, the implementor must ensure that | |