org.oddjob.io
Class Files

java.lang.Object
  extended by org.oddjob.io.Files

public class Files
extends Object

Utility methods for dealing with files.

Author:
Rob Gordon

Constructor Summary
Files()
           
 
Method Summary
static File[] expand(File file)
          Expand a file that could contain wild cards.
static File[] expand(File[] files)
          Expand an array of files which could contain wildcards into an actual array of files.
static void verifyReadable(File[] files)
          Verify that all files are readable.
static void verifyWrite(File[] files)
          Verify that files are writeable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Files

public Files()
Method Detail

expand

public static File[] expand(File file)
Expand a file that could contain wild cards.

Parameters:
file - The file.
Returns:
An array of files. Never null.

expand

public static File[] expand(File[] files)
Expand an array of files which could contain wildcards into an actual array of files. The array will be sorted.

Parameters:
files - The in files.
Returns:
The expanded files

verifyReadable

public static void verifyReadable(File[] files)
                           throws RuntimeException
Verify that all files are readable.

Parameters:
files - The files.
Throws:
RuntimeException

verifyWrite

public static void verifyWrite(File[] files)
                        throws RuntimeException
Verify that files are writeable.

Parameters:
files - The files.
Throws:
RuntimeException