Package net.stoerr.chatgpt.codevengine
Class TbUtils
- java.lang.Object
-
- net.stoerr.chatgpt.codevengine.TbUtils
-
public class TbUtils extends Object
Catch-all class for various utilities not related to a class.
-
-
Field Summary
Fields Modifier and Type Field Description static PrintStreamERRLOGstatic PrintStreamLOG
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description protected static voidaddShortContentReport(String content, StringBuilder output)protected static StringcompileReplacement(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 whatMatcher.appendReplacement(StringBuffer, String)expects.protected static longlineNumberAfter(String contentpart)protected static voidlogBody(String parameterName, String parameterValue)protected static voidlogRequest(jakarta.servlet.http.HttpServletRequest request)If there is a file named .cgptcodeveloper/.requestlog.txt, we append the request data to it.static voidsetQuiet(boolean quiet)
-
-
-
Field Detail
-
ERRLOG
public static final PrintStream ERRLOG
-
LOG
public static final PrintStream LOG
-
-
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.
-
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 whatMatcher.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)
-
setQuiet
public static void setQuiet(boolean quiet)
-
-