dochelper.util
Class FileUtils

java.lang.Object
  extended by dochelper.util.FileUtils

public class FileUtils
extends java.lang.Object

The class FileUtils groups file handling utility methods. The globToRE and listDirectories methods are courtesy of JEdit source code (MiscUtilities.java) also under the GNU General Public License. Pertinent notice follows: Copyright (C) 1999, 2004 Slava Pestov Portions copyright (C) 2000 Richard S. Hall Portions copyright (C) 2001 Dirk Moebius This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.


Constructor Summary
FileUtils()
          Creates a new instance of FileUtils
 
Method Summary
static java.io.File[] _listDirectory(java.lang.String path)
          List the contents of a directory of fail.
static java.lang.String FileToString(java.io.File file)
          Read a file as text and return a String
static java.lang.String globToRE(java.lang.String glob)
          Converts a Unix-style glob to a regular expression.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileUtils

public FileUtils()
Creates a new instance of FileUtils

Method Detail

globToRE

public static java.lang.String globToRE(java.lang.String glob)
Converts a Unix-style glob to a regular expression.

? becomes ., * becomes .*, {aa,bb} becomes (aa|bb).

Parameters:
glob - The glob pattern
Returns:

_listDirectory

public static java.io.File[] _listDirectory(java.lang.String path)
List the contents of a directory of fail.

Parameters:
path -
Returns:

FileToString

public static java.lang.String FileToString(java.io.File file)
                                     throws java.io.FileNotFoundException,
                                            java.io.IOException
Read a file as text and return a String

Parameters:
file -
Returns:
Throws:
java.io.FileNotFoundException
java.io.IOException