com.izforge.izpack.util
Class FileUtil

java.lang.Object
  extended bycom.izforge.izpack.util.FileUtil

public class FileUtil
extends java.lang.Object

Provides general global file utility methods

Author:
marc.eppelmann

Constructor Summary
FileUtil()
          Creates a new FileUtil object.
 
Method Summary
static boolean fileContains(java.lang.String aFileName, java.lang.String aSearchString)
          Searches case sensitively, and returns true if the given SearchString occurs in the first File with the given Filename.
static boolean fileContains(java.lang.String aFileName, java.lang.String aSearchString, boolean caseInSensitiveSearch)
          Tests if the given File contains the given Search String
static java.util.ArrayList getFileContent(java.lang.String fileName)
          Gets the content from a File as StringArray List.
static void main(java.lang.String[] args)
          Test main
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileUtil

public FileUtil()
Creates a new FileUtil object.

Method Detail

getFileContent

public static java.util.ArrayList getFileContent(java.lang.String fileName)
                                          throws java.io.IOException
Gets the content from a File as StringArray List.

Parameters:
fileName - A file to read from.
Returns:
List of individual line of the specified file. List may be empty but not null.
Throws:
java.io.IOException

fileContains

public static boolean fileContains(java.lang.String aFileName,
                                   java.lang.String aSearchString)
Searches case sensitively, and returns true if the given SearchString occurs in the first File with the given Filename.

Parameters:
aFileName - A files name
aSearchString - the string search for
Returns:
true if found in the file otherwise false

fileContains

public static boolean fileContains(java.lang.String aFileName,
                                   java.lang.String aSearchString,
                                   boolean caseInSensitiveSearch)
Tests if the given File contains the given Search String

Parameters:
aFileName - A files name
aSearchString - the String to search for
caseInSensitiveSearch - If false the Search is casesensitive
Returns:
true if found in the file otherwise false

main

public static void main(java.lang.String[] args)
Test main

Parameters:
args -