Package org.dbunit.util
Class FileHelper
java.lang.Object
org.dbunit.util.FileHelper
Utility that provides some general methods for working with
File objects.- Since:
- 2.3.0
- Version:
- $Revision$
- Author:
- gommma
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidCopy file.static InputSourcecreateInputSource(File file) static booleandeleteDirectory(File directory) Recursively deletes the given directorystatic voiddeleteDirectory(File directory, boolean failOnError) Recursively deletes the given directorystatic ListGet a list of Strings from a given file.
-
Method Details
-
deleteDirectory
Recursively deletes the given directory- Parameters:
directory- The directory to deletefailOnError- If an exception should be thrown in case the deletion did not work.
-
deleteDirectory
Recursively deletes the given directory- Parameters:
directory- The directory to delete- Returns:
trueif the deletion was successfully.
-
createInputSource
- Throws:
MalformedURLException
-
copyFile
Copy file.- Parameters:
srcFile- the src filedestFile- the dest file- Throws:
IOException
-
readLines
Get a list of Strings from a given file. Uses the default encoding of the current platform.- Parameters:
theFile- the file to be read- Returns:
- a list of Strings, each one representing one line from the given file
- Throws:
IOException
-