Class FileUtil
java.lang.Object
org.locationtech.jtstest.util.FileUtil
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidCopies the source file to the destination filename.static voiddeleteFiles(String directoryName) Deletes the files in the directory, but does not remove the directory.static booleandirectoryExists(String directoryName) Returns true if the given directory exists.static Stringstatic ListgetContents(String textFileName) Returns a List of the String's in the text file, one per line.static Stringstatic StringGets the contents of a text file as a single Stringstatic Stringstatic voidsetContents(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:
FileNotFoundExceptionIOException
-
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
-