Package gov.nasa.pds.tools.util
Class DocumentUtil
java.lang.Object
gov.nasa.pds.tools.util.DocumentUtil
Util class to parse and remove comments from a Document object. It will also keep a mapping of
document type to ProblemType to allow the retrieval of ProblemType based on document type.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetDocumentWithoutComments(URL fileUrl) Returns the content of the file minus the comments as String.getProblemType(String docType) Returns the enum ProblemType based on the docType.Read the content of the file and returns the content of the file as String.
-
Constructor Details
-
DocumentUtil
public DocumentUtil()
-
-
Method Details
-
getProblemType
Returns the enum ProblemType based on the docType.- Parameters:
docType- The string represent the document type.- Returns:
- problemType The matching ProblemType based on the document type. Can be null if not matching ProblemType can be found.
-
readFile
Read the content of the file and returns the content of the file as String.- Parameters:
fileUrl- The URL of the file.- Returns:
- The content of the file as String.
-
getDocumentWithoutComments
Returns the content of the file minus the comments as String.- Parameters:
fileUrl- The URL of the file.- Returns:
- documentContent The content of the file minus the comments as String.
-