org.znerd.util.io
Class DirectoryUtils

java.lang.Object
  extended by org.znerd.util.io.DirectoryUtils

public class DirectoryUtils
extends Object


Method Summary
static void checkDir(String description, File path, boolean mustBeReadable, boolean mustBeWritable, boolean createIfNonexistent)
          Checks if the specified abstract path name refers to an existing directory and creates the directory if appropriate.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

checkDir

public static final void checkDir(String description,
                                  File path,
                                  boolean mustBeReadable,
                                  boolean mustBeWritable,
                                  boolean createIfNonexistent)
                           throws IllegalArgumentException,
                                  IOException
Checks if the specified abstract path name refers to an existing directory and creates the directory if appropriate.

Parameters:
description - the description of the directory, cannot be null.
path - the abstract path name as a File object.
mustBeReadable - true if the directory must be readable.
mustBeWritable - true if the directory must be writable.
Throws:
IllegalArgumentException - if description == null || description.trim().equals("") || path == null.
IOException - if ! path.exists() || ! path.isDirectory() || (mustBeReadable && !path.canRead()) || (mustBeWritable && !path.canWrite()).


Copyright © 2011-2012. All Rights Reserved.