Class WriteStringToFile
Object
WriteStringToFile
Writes a string to a text file.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidwriteTextFile(String contents, Path filePath) Creates a new text-file atfilePathwhose contents arecontents.
-
Method Details
-
writeTextFile
Creates a new text-file atfilePathwhose contents arecontents.- Parameters:
contents- successive characters that will be written to the text-file.filePath- the path of the text-file, which will be overwritten if it already exists.- Throws:
IOException- if the file already exists and is a directory, or if it cannot be created.
-