File tree Expand file tree Collapse file tree 1 file changed +3
-13
lines changed
fineract-provider/src/main/java/org/apache/fineract/template/service Expand file tree Collapse file tree 1 file changed +3
-13
lines changed Original file line number Diff line number Diff line change 2222import com .github .mustachejava .DefaultMustacheFactory ;
2323import com .github .mustachejava .Mustache ;
2424import com .github .mustachejava .MustacheFactory ;
25- import java .io .BufferedReader ;
2625import java .io .IOException ;
2726import java .io .InputStream ;
28- import java .io .InputStreamReader ;
2927import java .io .StringReader ;
3028import java .io .StringWriter ;
3129import java .net .Authenticator ;
@@ -55,21 +53,13 @@ public class TemplateMergeService {
5553
5654 private final FineractProperties fineractProperties ;
5755
58- // TODO Replace this with appropriate alternative available in Guava
5956 private static String getStringFromInputStream (final InputStream is ) {
60- final StringBuilder sb = new StringBuilder ();
61-
62- String line ;
63- try (BufferedReader br = new BufferedReader (new InputStreamReader (is , StandardCharsets .UTF_8 ))) {
64-
65- while ((line = br .readLine ()) != null ) {
66- sb .append (line );
67- }
57+ try {
58+ return new String (is .readAllBytes (), StandardCharsets .UTF_8 );
6859 } catch (final IOException e ) {
6960 log .error ("getStringFromInputStream() failed" , e );
61+ return "" ;
7062 }
71-
72- return sb .toString ();
7363 }
7464
7565 public String compile (final Template template , final Map <String , Object > scopes ) {
You can’t perform that action at this time.
0 commit comments