public final class Compress extends Object
| Modifier and Type | Method and Description |
|---|---|
static long |
copy(InputStream is,
OutputStream os) |
static long |
copy(InputStream is,
OutputStream os,
int buffSize)
Equivalent to guava ByteStreams.copy, with one special behavior: if is has no bytes immediately available for read,
the os is flushed prior to the next read that will probably block.
|
static void |
copyFileAtomic(Path source,
Path destinationFile)
Copy file atomic.
|
static List<Path> |
unzip(Path zipFile)
Unzip a zip archive to same folder.
|
static List<Path> |
unzip(Path zipFile,
Path destinationDirectory)
Unzip a zip file to a destination folder.
|
static Path |
zip(Path fileOrFolderToCompress)
Zip a file or folder.
|
static void |
zip(Path fileOrFolderToCompress,
Path destFile)
Zip a file or folder.
|
public static Path zip(Path fileOrFolderToCompress) throws IOException
fileOrFolderToCompress - file or folder to compress.IOExceptionpublic static void zip(Path fileOrFolderToCompress, Path destFile) throws IOException
fileOrFolderToCompress - file or folder to compress.destFile - the destination zip file.IOExceptionpublic static void copyFileAtomic(Path source, Path destinationFile) throws IOException
source - destinationFile - IOExceptionpublic static List<Path> unzip(Path zipFile) throws IOException
zipFile - IOExceptionpublic static List<Path> unzip(Path zipFile, Path destinationDirectory) throws IOException
zipFile - destinationDirectory - IOException - in case extraction fails for whatever reason.public static long copy(InputStream is, OutputStream os) throws IOException
IOExceptionpublic static long copy(InputStream is, OutputStream os, int buffSize) throws IOException
is - os - buffSize - IOExceptionCopyright © 2018 SPF4J. All rights reserved.