public final class IOUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
deleteResources(File... files)
Delete the given files and all the files with the same name but different
extension.
|
static List<File> |
unzip(File file,
String extension)
Unzip the file.
|
static List<File> |
unzip(File file,
String extension,
File directory) |
static List<File> |
unzipAll(File file) |
static Path |
writeBase64(String extension,
InputStream input) |
static File |
writeBase64ToFile(InputStream input,
String extension)
Reads the given input stream as a string and decodes that base64 string
into a file with the specified extension
|
static File |
writeStreamToFile(InputStream inputStream,
String extension) |
static File |
writeStreamToFile(InputStream inputStream,
String extension,
File file)
|
static File |
zip(File... files)
Zip the files.
|
public static File writeBase64ToFile(InputStream input, String extension) throws IOException
input - the stream with the base64 stringextension - the extension of the result file (without the '.' at the
beginning)IOException - if an error occurs while writing the contents to diskpublic static File writeStreamToFile(InputStream inputStream, String extension) throws IOException
IOException@Deprecated public static File writeStreamToFile(InputStream inputStream, String extension, File file) throws IOException
inputStream - the input streamextension - the file extension (ignored)file - the fileIOException - if an error occurspublic static File zip(File... files) throws IOException
files - files to zippedIOException - if the zipping process fails.public static List<File> unzip(File file, String extension) throws IOException
file - the file to unzipextension - the extension to search in the content filesIOException - if the unzipping process failspublic static List<File> unzip(File file, String extension, File directory) throws IOException
IOExceptionpublic static List<File> unzipAll(File file) throws IOException
IOExceptionpublic static void deleteResources(File... files)
null just doesn't process it and
continue to the next element of the arrayfiles - the files to deletepublic static Path writeBase64(String extension, InputStream input) throws IOException
IOExceptionCopyright © 2016–2021 52°North Initiative for Geospatial Open Source Software GmbH. All rights reserved.