
com.mntviews.jreport.JRUtil Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mnt-report Show documentation
Show all versions of mnt-report Show documentation
JasperReport server engine
package com.mntviews.jreport;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import java.util.stream.Collectors;
public class JRUtil {
public static String convertResourceToString(String fileName) throws IOException {
try (InputStream inputStream = JRUtil.class.getClassLoader().getResourceAsStream(fileName)) {
if (inputStream == null)
return null;
try (BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream, StandardCharsets.UTF_8))) {
return bufferedReader.lines().collect(Collectors.joining(System.lineSeparator()));
}
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy