Minor refactoring in MultipartParser

Move the nested InternalParser class up, merging it with the top-level
MultipartParser, make the constructor private, and expose a static
parse method.
This commit is contained in:
rstoyanchev
2026-06-17 13:05:10 +01:00
parent 7565c51dc5
commit 97db213d41
3 changed files with 457 additions and 459 deletions
@@ -189,8 +189,7 @@ class MultipartParserTests {
private void parse(String fileName, String boundary, MultipartParser.PartListener listener) throws Exception {
try (InputStream input = createStream(fileName)) {
MultipartParser multipartParser = new MultipartParser(10 * 1024, 4 * 1024);
multipartParser.parse(input, boundary.getBytes(UTF_8), StandardCharsets.UTF_8, listener);
MultipartParser.parse(input, boundary.getBytes(UTF_8), UTF_8, 10 * 1024, 4 * 1024, listener);
}
}