|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.izforge.izpack.util.FileUtil
public class FileUtil
Provides general global file utility methods
| Constructor Summary | |
|---|---|
FileUtil()
|
|
| Method Summary | |
|---|---|
static File |
convertUrlToFile(URL url)
|
static String |
convertUrlToFilePath(URL url)
|
static boolean |
fileContains(String aFileName,
String aSearchString)
Searches case sensitively, and returns true if the given SearchString occurs in the first File with the given Filename. |
static boolean |
fileContains(String aFileName,
String aSearchString,
boolean caseInSensitiveSearch)
Tests if the given File contains the given Search String |
static File |
getAbsoluteFile(String filename,
String basedir)
Gets an absolute file from a filename. |
static List<String> |
getFileContent(String fileName)
Gets the content from a File as StringArray List. |
static long |
getFileDateTime(URL url)
Gets file date and time. |
static String[] |
getFileNames(String dirPath)
|
static String[] |
getFileNames(String dirPath,
FilenameFilter fileNameFilter)
|
static File |
getLockFile(String applicationName)
|
static String |
getRelativeFileName(File file,
File basedir)
Gets a relative file from a filename against a base directory. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FileUtil()
| Method Detail |
|---|
public static File convertUrlToFile(URL url)
public static String convertUrlToFilePath(URL url)
public static File getLockFile(String applicationName)
public static List<String> getFileContent(String fileName)
throws IOException
fileName - A file to read from.
IOException
public static boolean fileContains(String aFileName,
String aSearchString)
aFileName - A files nameaSearchString - the string search for
public static boolean fileContains(String aFileName,
String aSearchString,
boolean caseInSensitiveSearch)
aFileName - A files nameaSearchString - the String to search forcaseInSensitiveSearch - If false the Search is casesensitive
public static long getFileDateTime(URL url)
url - The URL of the file for which date and time will be returned.
public static String[] getFileNames(String dirPath)
throws Exception
Exception
public static String[] getFileNames(String dirPath,
FilenameFilter fileNameFilter)
throws Exception
Exception
public static File getAbsoluteFile(String filename,
String basedir)
filename - The filename to build an absolute file frombasedir - The base directory for a relative filename
public static String getRelativeFileName(File file,
File basedir)
throws IOException
filename - The filename to build a relative file frombasedir - The base directory for a relative filename
IOException - if the file paths cannot be canonicalized
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||