public class ZipArchives extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
createArchive(Path archive,
Path sourceDirectory)
Creates a ZIP archive from the contents of the given directory.
|
static void |
createArchive(Path archive,
Path sourceDirectory,
Charset charset)
Creates a ZIP archive from the contents of the given directory.
|
static void |
extractArchive(Path archive,
Path destinationDirectory)
Extracts the contents of the given ZIP archive into the given directory.
|
static void |
extractArchive(Path archive,
Path destinationDirectory,
Charset charset)
Extracts the contents of the given ZIP archive into the given directory.
|
static void |
walkArchiveTree(Path archive,
FileVisitor<? super Path> visitor)
Walks the file tree of the given ZIP archive.
|
static void |
walkArchiveTree(Path archive,
FileVisitor<? super Path> visitor,
Charset charset)
Walks the file tree of the given ZIP archive.
|
static void |
walkArchiveTree(Path archive,
int maxDepth,
FileVisitor<? super Path> visitor)
Walks the file tree of the given ZIP archive up to the given maximum depth.
|
static void |
walkArchiveTree(Path archive,
int maxDepth,
FileVisitor<? super Path> visitor,
Charset charset)
Walks the file tree of the given ZIP archive up to the given maximum depth.
|
public static void createArchive(Path archive, Path sourceDirectory) throws IOException
IllegalArgumentException - if archive is nullIllegalArgumentException - if sourceDirectory is nullIOException - if an I/O occurspublic static void createArchive(Path archive, Path sourceDirectory, Charset charset) throws IOException
IllegalArgumentException - if archive is nullIllegalArgumentException - if sourceDirectory is nullIllegalArgumentException - if charset is nullIOException - if an I/O occurspublic static void extractArchive(Path archive, Path destinationDirectory) throws IOException
IllegalArgumentException - if archive is nullIllegalArgumentException - if destinationDirectory is nullIOException - if an I/O occurspublic static void extractArchive(Path archive, Path destinationDirectory, Charset charset) throws IOException
IllegalArgumentException - if archive is nullIllegalArgumentException - if destinationDirectory is nullIllegalArgumentException - if charset is nullIOException - if an I/O occurspublic static void walkArchiveTree(Path archive, FileVisitor<? super Path> visitor) throws IOException
IllegalArgumentException - if archive is nullIllegalArgumentException - if visitor is nullIOException - if an I/O occurspublic static void walkArchiveTree(Path archive, FileVisitor<? super Path> visitor, Charset charset) throws IOException
IllegalArgumentException - if archive is nullIllegalArgumentException - if visitor is nullIllegalArgumentException - if charset is nullIOException - if an I/O occurspublic static void walkArchiveTree(Path archive, int maxDepth, FileVisitor<? super Path> visitor) throws IOException
IllegalArgumentException - if archive is nullIllegalArgumentException - if visitor is nullIOException - if an I/O occurspublic static void walkArchiveTree(Path archive, int maxDepth, FileVisitor<? super Path> visitor, Charset charset) throws IOException
IllegalArgumentException - if archive is nullIllegalArgumentException - if maxDepth is negativeIllegalArgumentException - if visitor is nullIllegalArgumentException - if charset is nullIOException - if an I/O occurs