public class IOHelper extends Object
Constructor and Description |
---|
IOHelper() |
Modifier and Type | Method and Description |
---|---|
static void |
compressFilesToZip(File[] files,
File zipFile) |
static void |
decompressAll(File zipFile,
File targetDirectory) |
static String |
readText(File file) |
static String |
readText(InputStream in) |
static String |
readText(URL url) |
static void |
saveFile(File filename,
File fileIn) |
static void |
saveFile(File file,
InputStream in) |
static void |
saveFile(File filename,
String stringToStoreInFile) |
static void |
saveFile(OutputStream out,
InputStream in) |
static void |
saveFile(String filename,
String msg,
boolean append) |
static void |
saveFile(String filename,
URL url) |
static String |
supplyProperty(String key,
URL url) |
public static String readText(InputStream in) throws IOException
IOException
public static String readText(URL url) throws IOException
IOException
public static String readText(File file) throws IOException
IOException
public static String supplyProperty(String key, URL url) throws IOException
IOException
public static void saveFile(OutputStream out, InputStream in) throws IOException
IOException
public static void saveFile(String filename, URL url) throws IOException
IOException
public static void saveFile(File file, InputStream in) throws IOException
IOException
public static void saveFile(File filename, File fileIn) throws IOException
IOException
public static void saveFile(File filename, String stringToStoreInFile) throws IOException
IOException
public static void saveFile(String filename, String msg, boolean append) throws IOException
filename
- the file to write tomsg
- the message to write or append to fileappend
- replace file or append to file
if true
, then bytes will be written to the end of the file rather than the
beginningIOException
- thrown if writing to file is not possible.public static void decompressAll(File zipFile, File targetDirectory) throws IOException, ZipException
IOException
ZipException
public static void compressFilesToZip(File[] files, File zipFile) throws IOException, ZipException
IOException
ZipException
Copyright © 2012–2017 52North Initiative for Geospatial Open Source Software GmbH. All rights reserved.