|
Groovy Documentation | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | PROPERTY | CONSTR | METHOD | DETAIL: FIELD | PROPERTY | CONSTR | METHOD |
java.lang.Objectutils.gate.util.FileUtils
class FileUtils
Some file utilities.
Property Summary | |
---|---|
static Pattern |
META_ENCODING_PATTERN
A regex pattern used to find the encoding from a meta tag such as |
static Pattern |
XML_ENCODING_PATTERN
A regex pattern used to find the encoding from an XML declaration such as |
static Logger |
log
Logger |
Constructor Summary | |
FileUtils()
|
Method Summary | |
---|---|
static String
|
decodeHtmlFile(File htmlFile)
Return the String contents of an html file, decoded according to the encodings given in any xml declaration or meta tag. |
static List
|
dirList(File dir)
List all the entries in a directory, with dot files last. |
static File
|
findFileInTree(String fileName, File topDir, File startDir)
Find the first occurence of a file above a location in a directory tree up to and including a particular top directory. |
static String
|
getBody(InputStream htmlFile)
Get the body of an HTML file. |
static String
|
getBody(File htmlFile)
Get the body of an HTML file. |
static String
|
getBody(String text)
Get the body of an HTML file. |
static boolean
|
isValidFileName(String path)
Do some basic validity checks on a file name. |
static void
|
putBody(File htmlFile, String text)
Take the html body given by a String text, and place it in the body of the html File htmlFile. |
static String
|
replaceFileSuffix(File file, String newSuffix)
Replace the suffix of a file name. |
static String
|
replaceFileSuffix(String path, String newSuffix)
Replace the suffix of a file name. |
static String
|
setBodyDiv(String pageString, String divId, String text)
Set the value (content) of a DIV occuring in the BODY string of an HTML file according to its ID. |
Methods inherited from class Object | |
---|---|
wait, wait, wait, hashCode, getClass, equals, toString, notify, notifyAll |
Property Detail |
---|
static Pattern META_ENCODING_PATTERN
static Pattern XML_ENCODING_PATTERN
static Logger log
Constructor Detail |
---|
FileUtils()
Method Detail |
---|
public static String decodeHtmlFile(File htmlFile)
public static List dirList(File dir)
public static File findFileInTree(String fileName, File topDir, File startDir)
public static String getBody(InputStream htmlFile)
public static String getBody(File htmlFile)
public static String getBody(String text)
public static boolean isValidFileName(String path)
public static void putBody(File htmlFile, String text)
public static String replaceFileSuffix(File file, String newSuffix)
public static String replaceFileSuffix(String path, String newSuffix)
public static String setBodyDiv(String pageString, String divId, String text)
Groovy Documentation