Package org.locationtech.jtstest.util
Class FileUtil
java.lang.Object
org.locationtech.jtstest.util.FileUtil
Useful file utilities.
- Version:
- 1.7
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
Copies the source file to the destination filename.static void
deleteFiles
(String directoryName) Deletes the files in the directory, but does not remove the directory.static boolean
directoryExists
(String directoryName) Returns true if the given directory exists.static String
static List
getContents
(String textFileName) Returns a List of the String's in the text file, one per line.static String
static String
Gets the contents of a text file as a single Stringstatic String
static void
setContents
(String textFileName, String contents) Saves the String with the given filename
-
Field Details
-
EXTENSION_SEPARATOR
- See Also:
-
-
Constructor Details
-
FileUtil
public FileUtil()
-
-
Method Details
-
name
-
extension
-
deleteFiles
Deletes the files in the directory, but does not remove the directory. -
directoryExists
Returns true if the given directory exists. -
getContents
Returns a List of the String's in the text file, one per line.- Throws:
FileNotFoundException
IOException
-
readText
- Throws:
IOException
-
readText
Gets the contents of a text file as a single String- Parameters:
file
-- Returns:
- text file contents
- Throws:
IOException
-
setContents
Saves the String with the given filename- Throws:
IOException
-
copyFile
Copies the source file to the destination filename. Posted by Mark Thornton invalid input: '<'mthorn@cix.compulink.co.uk> on Usenet.- Throws:
IOException
-