org.n52.oxf.util
Class IOHelper

java.lang.Object
  extended by org.n52.oxf.util.IOHelper

public class IOHelper
extends Object

Some little helper methods for IO-handling.

Author:
Arne Bröring, Eike Hinderk Jürrens, Henning Bredel

Constructor Summary
IOHelper()
           
 
Method Summary
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)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IOHelper

public IOHelper()
Method Detail

readText

public static String readText(InputStream in)
                       throws IOException
Throws:
IOException

readText

public static String readText(URL url)
                       throws IOException
Throws:
IOException

readText

public static String readText(File file)
                       throws IOException
Throws:
IOException

supplyProperty

public static String supplyProperty(String key,
                                    URL url)
                             throws IOException
Throws:
IOException

saveFile

public static void saveFile(OutputStream out,
                            InputStream in)
                     throws IOException
Throws:
IOException

saveFile

public static void saveFile(String filename,
                            URL url)
                     throws IOException
Throws:
IOException

saveFile

public static void saveFile(File file,
                            InputStream in)
                     throws IOException
Throws:
IOException

saveFile

public static void saveFile(File filename,
                            File fileIn)
                     throws IOException
Throws:
IOException

saveFile

public static void saveFile(File filename,
                            String stringToStoreInFile)
                     throws IOException
Throws:
IOException

saveFile

public static void saveFile(String filename,
                            String msg,
                            boolean append)
                     throws IOException
Parameters:
filename -
msg -
append - if true, then bytes will be written to the end of the file rather than the beginning
Throws:
IOException

decompressAll

public static void decompressAll(File zipFile,
                                 File targetDirectory)
                          throws IOException,
                                 ZipException
Throws:
IOException
ZipException

compressFilesToZip

public static void compressFilesToZip(File[] files,
                                      File zipFile)
                               throws IOException,
                                      ZipException
Throws:
IOException
ZipException


Copyright © 2012-2013 52north.org. All Rights Reserved.