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 PrintStream
ERRLOG
static PrintStream
LOG
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description protected static void
addShortContentReport(String content, StringBuilder output)
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.protected static long
lineNumberAfter(String contentpart)
protected static void
logBody(String parameterName, String parameterValue)
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.static void
setQuiet(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)
-
-