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