Package gov.nasa.pds.tools.util
Class FileService
java.lang.Object
gov.nasa.pds.tools.util.FileService
A class to allow reading and writing text file.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidappendTextToOneLine(String filename, String textStr) Open the file for writing and write a text string.static voidappendTextToOneLine(String filename, String[] textArray) Open the file for writing and write textArray separated by a space to file all in one line.static voidstatic voidprintDocumentToFile(String filename, DOMSource domSource) Print a document (DOMSource) to a text file.static voidprintDocumentToFile(String filename, Document docSource) Print a document to a text file.static voidprintStackTraceToFile(String filename, Exception exception) Print a stack trace to a text file.
-
Constructor Details
-
FileService
public FileService()
-
-
Method Details
-
main
-
appendTextToOneLine
Open the file for writing and write a text string.- Parameters:
filename- Output filenametextArray- An array of strings
-
appendTextToOneLine
Open the file for writing and write textArray separated by a space to file all in one line.- Parameters:
filename- Output filenametextArray- An array of strings
-
printStackTraceToFile
Print a stack trace to a text file.- Parameters:
filename- Output filename.exception- The exception to print stack trace of.
-
printDocumentToFile
Print a document to a text file.- Parameters:
filename- Output filename.docSource- The document (Document) to be printed
-
printDocumentToFile
Print a document (DOMSource) to a text file.- Parameters:
filename- Output filename.domSource- The DOM source to be printed
-