public class BootstrapUtils extends Object
| Constructor and Description |
|---|
BootstrapUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
createDir(File dir) |
static File |
createTempDir() |
static File |
createTempDir(String prefix) |
static boolean |
isWindows() |
static Object |
readObject(File file) |
static RuntimeException |
unchecked(Throwable e) |
static void |
unzip(File srcFile,
File destDir)
Unzip files matching specified matcher from specified file to specified directory.
|
static void |
unzip(InputStream is,
File destDir)
Unzip files matching specified matcher from input stream to specified directory.
|
static void |
zip(File dir,
File file)
Zip specified directory recursively as specified file.
|
static void |
zip(File dir,
OutputStream os)
Zip specified directory recursively as specified file.
|
public static File createTempDir()
public static RuntimeException unchecked(Throwable e)
public static void createDir(File dir)
public static void zip(File dir, File file)
dir - file - public static void zip(File dir, OutputStream os)
dir - file - public static void unzip(File srcFile, File destDir)
srcFile - zip file to extract fromdestDir - destination directory to extract tomatcher - if not null, only entries with name matching this param in the zip will be extracted.
Use null if you want to extract all entries from the zip file.public static void unzip(InputStream is, File destDir)
is - input stream to unzip files from. This method will not close the stream
after using it. Caller should be responsible for closingdestDir - destination directory to extract files topublic static boolean isWindows()
Copyright © 2018–2020 mhoffrog. All rights reserved.