String (InputStream is) { if (is != null) { StringBuilder sb = new StringBuilder(); try (BufferedReader reader = new BufferedReader(new InputStreamReader(is, StandardCharsets.UTF_8))) { String line; while ((line = reader.readLine()) != null) { sb.append(line).append('\n'); } } catch (Exception e) { throw new RuntimeException(e); } return sb.toString(); } else { return ""; } }