Skip navigation links


org.apache.myfaces.trinidad.util
Class FileUtils

java.lang.Object
  extended by org.apache.myfaces.trinidad.util.FileUtils


public final class FileUtils
extends Object

File-related utilities.


Method Summary
static File toWritableDirectory(String path)
          Converts the specified directory path to a File instance representing an existing, writable directory.

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Method Detail

toWritableDirectory

public static File toWritableDirectory(String path)
                                throws IOException
Converts the specified directory path to a File instance representing an existing, writable directory. This method will attempt to create a directory on the file system if it does not already exist. It does not, however, attempt to modify write permissions. This method is thread safe. However, there is no way to prevent other threads from modifying the file system, which can lead to unexpected results. For example, toWritableDirectory may return a File that it thinks is writable, but which has actually been removed from the file system by another thread.
Parameters:
path - the path to convert to a File
Returns:
a File corresponding to the specified path
Throws:
IOException - if directory at the specified path does not exist/cannnot be created, or is not writable.

Skip navigation links


Copyright © 2001-2013 The Apache Software Foundation. All Rights Reserved.