Package gov.nasa.pds.tools.util
Class FileService
java.lang.Object
gov.nasa.pds.tools.util.FileService
public class FileService extends Object
A class to allow reading and writing text file.
-
Constructor Summary
Constructors Constructor Description FileService()
-
Method Summary
Modifier and Type Method Description static void
appendTextToOneLine(String filename, String textStr)
Open the file for writing and write a text string.static void
appendTextToOneLine(String filename, String[] textArray)
Open the file for writing and write textArray separated by a space to file all in one line.static void
main(String[] args)
static void
printDocumentToFile(String filename, DOMSource domSource)
Print a document (DOMSource) to a text file.static void
printDocumentToFile(String filename, Document docSource)
Print a document to a text file.static void
printStackTraceToFile(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
-