Class TbUtils


  • public class TbUtils
    extends Object
    Catch-all class for various utilities not related to a class.
    • Constructor Detail

      • TbUtils

        public TbUtils()
    • Method Detail

      • logRequest

        protected static void logRequest​(jakarta.servlet.http.HttpServletRequest request)
        If there is a file named .cgptcodeveloper/.requestlog.txt, we append the request data to it.
      • logBody

        protected static void logBody​(String parameterName,
                                      String parameterValue)
      • compileReplacement

        protected static String compileReplacement​(jakarta.servlet.http.HttpServletResponse response,
                                                   String replacementWithGroupReferences)
        Transforms our simpler specification of replacement patterns (group references $0, $1, ..., $9 with the corresponding groups from the match; a literal $ must be given as $$) to what Matcher.appendReplacement(StringBuffer, String) expects. We want to simplify the backslash handling, as backslashes are pretty common in Java source code, while $ is not.
      • addShortContentReport

        protected static void addShortContentReport​(String content,
                                                    StringBuilder output)
      • lineNumberAfter

        protected static long lineNumberAfter​(String contentpart)