Package gov.nasa.pds.tools.util
Class DocumentUtil
- java.lang.Object
-
- gov.nasa.pds.tools.util.DocumentUtil
-
public class DocumentUtil extends Object
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 Constructor Description DocumentUtil()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getDocumentWithoutComments(URL fileUrl)
Returns the content of the file minus the comments as String.ProblemType
getProblemType(String docType)
Returns the enum ProblemType based on the docType.String
readFile(URL fileUrl)
Read the content of the file and returns the content of the file as String.
-
-
-
Method Detail
-
getProblemType
public ProblemType getProblemType(String docType)
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
public String readFile(URL fileUrl)
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.
-
-