If my multipart post is bigger than MultipartConfigElement.fileSizeThreshold thanMultipartConfigElement.fileSizeThreshold, then my post is out of a temporary file. Undertow FileUtils read it so:
public static String readFile(InputStream file, Charset charSet) { try (BufferedInputStream stream = new BufferedInputStream(file)) { byte[] buff = new byte[1024]; StringBuilder builder = new StringBuilder(); int read; while ((read = stream.read(buff)) != -1) { builder.append(new String(buff, 0, read, charSet)); } return builder.toString(); } catch (IOException e) { throw new RuntimeException(e); } } If I understand this good, this code can cut in two slice one UTF-8 non-English Charactercharacter and concat it as two bad character.
támogat��s
támogat��s I hava 'á'have a á character and now two bad...
What is the best solution of this problem?
a, undertow jira ticket b, Increase treshold size? c, Leave multipart if it is possible (i think not)
- Undertow jira ticket
- Increase treshold size?
- Leave multipart if it is possible (I think not)
HaveDoes somebody have any experience ofwith this?
Thanks a lot. H.