Class 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 Detail

      • DocumentUtil

        public DocumentUtil()
    • 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.
      • getDocumentWithoutComments

        public String getDocumentWithoutComments​(URL fileUrl)
        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.