com.emarsys.ecommon.io
Class IOUtil

java.lang.Object
  extended by com.emarsys.ecommon.io.IOUtil

public class IOUtil
extends java.lang.Object

Utilities for handling I/O.

Author:
Michael "kULO" Kulovits

Constructor Summary
IOUtil()
           
 
Method Summary
static void makeParentDirectories(java.io.File file)
           Creates all yet missing parent directories for the passed File.
static void silentClose(java.io.Closeable closeable)
          Closes the passed Closeable and prints a warning (containing a reference to the calling method) to the logs if an IOException arises.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IOUtil

public IOUtil()
Method Detail

makeParentDirectories

public static void makeParentDirectories(java.io.File file)
                                  throws java.lang.IllegalArgumentException,
                                         java.io.IOException

Creates all yet missing parent directories for the passed File.

If the file does not have any parent directories or if they already exist, then no action will be performed.

If it's not possible to create at least one of the parent directories then an IOException will be raised.

Parameters:
file -
Throws:
java.lang.IllegalArgumentException - - if file is null
java.io.IOException - - if the parent directory cannot be created

silentClose

public static void silentClose(java.io.Closeable closeable)
Closes the passed Closeable and prints a warning (containing a reference to the calling method) to the logs if an IOException arises.

Parameters:
closeable -


Copyright © 2010 emarsys AG. All Rights Reserved.