private Charset getCharset() { String name = MultipartUtils.getCharEncoding(headers()); return (name != null ? Charset.forName(name) : StandardCharsets.UTF_8); }
private Charset getCharset() { String name = MultipartUtils.getCharEncoding(headers()); return (name != null ? Charset.forName(name) : StandardCharsets.UTF_8); }
private Charset getCharset() { String name = MultipartUtils.getCharEncoding(headers()); return (name != null ? Charset.forName(name) : StandardCharsets.UTF_8); } }
private Charset getCharset() { String name = MultipartUtils.getCharEncoding(headers()); return (name != null ? Charset.forName(name) : StandardCharsets.UTF_8); }
/** * <p> Reads the form fields into a string. The method takes care of handling the char encoding. * <p> If an error occurs while reading the {@link StreamStorage}, an {@link IllegalStateException} will be thrown. * * @param streamStorage The stream storage. * @param headers The part headers. * @return The form parameter value as string. */ public static String readFormParameterValue(final StreamStorage streamStorage, final Map<String, List<String>> headers){ try { return IOUtils.inputStreamAsString(streamStorage.getInputStream(), MultipartUtils.getCharEncoding(headers)); }catch (Exception e){ throw new IllegalStateException("Unable to read the form parameter value", e); } }
/** * <p> Reads the form fields into a string. The method takes care of handling the char encoding. * <p> If an error occurs while reading the {@link StreamStorage}, an {@link IllegalStateException} will be thrown. * * @param streamStorage The stream storage. * @param headers The part headers. * @return The form parameter value as string. */ public static String readFormParameterValue(final StreamStorage streamStorage, final Map<String, List<String>> headers){ try { return IOUtils.inputStreamAsString(streamStorage.getInputStream(), MultipartUtils.getCharEncoding(headers)); }catch (Exception e){ throw new IllegalStateException("Unable to read the form parameter value", e); } }