0

Currently, I am detecting text/html or text/plain mime types by doing hack, which notices results that begin with and end with and make them html results. But now I also want to detect latex mime type and this hack is npt working anymore, but I cannot figure out the better way to create mime types. Here is my current code:

    private void method(String code) {
    HashMap<String, String> map3 = new HashMap<>();
    if(code != null){
          boolean resultHtml = code.startsWith("<html>") && code.endsWith("</html>");
          map3.put(resultHtml ? "text/html" : "text/plain", code);
        }
    }
fishera
  • 789
  • 2
  • 7
  • 26

0 Answers0