fnug.util
Class IOUtils

java.lang.Object
  extended by fnug.util.IOUtils

public class IOUtils
extends Object

Helper methods for i/o operations.

Author:
Martin Algesten

Constructor Summary
IOUtils()
           
 
Method Summary
static String md5(String s)
          Makes an md5 sum of the given string.
static String normalize(String path)
          Helper method to normalize ../foo/../bar/../ style paths.
static void rm(File cur)
          Recursively remove the given file.
static void spool(InputStream is, OutputStream os)
          Copies all bytes of the input stream to the output stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IOUtils

public IOUtils()
Method Detail

rm

public static void rm(File cur)
Recursively remove the given file.

Parameters:
cur - file to remove recursively.

md5

public static String md5(String s)
Makes an md5 sum of the given string.

Parameters:
s - string to make sum of.
Returns:
the md5 as hexadecimals.

spool

public static void spool(InputStream is,
                         OutputStream os)
                  throws IOException
Copies all bytes of the input stream to the output stream. Will not close any streams.

Parameters:
is - Read from
os - Write to.
Throws:
IOException - if any stream throws exception.

normalize

public static String normalize(String path)
Helper method to normalize ../foo/../bar/../ style paths.

Parameters:
path - to normalize
Returns:
the normalized path.


Copyright © 2012. All Rights Reserved.