Loading src/main/java/es/redmic/es/common/utils/ElasticSearchUtils.java +5 −3 Original line number Diff line number Diff line package es.redmic.es.common.utils; import java.io.BufferedReader; /*- * #%L * ElasticSearch Loading @@ -22,6 +24,7 @@ package es.redmic.es.common.utils; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; import java.lang.reflect.Field; Loading @@ -31,6 +34,7 @@ import java.util.List; import java.util.Map; import java.util.Map.Entry; import org.apache.commons.io.FileUtils; import org.apache.commons.io.IOUtils; import org.apache.lucene.search.join.ScoreMode; import org.elasticsearch.action.get.GetResponse; Loading Loading @@ -289,9 +293,7 @@ public class ElasticSearchUtils { public static String getScriptFile(String mappingFilePath) { try { InputStream resource = new ClassPathResource(mappingFilePath).getInputStream(); return IOUtils.toString(resource, Charset.forName(StandardCharsets.UTF_8.name())); return FileUtils.readFileToString(new ClassPathResource(mappingFilePath).getFile(), StandardCharsets.UTF_8); } catch (IOException e) { e.printStackTrace(); throw new ResourceNotFoundException(e); Loading Loading
src/main/java/es/redmic/es/common/utils/ElasticSearchUtils.java +5 −3 Original line number Diff line number Diff line package es.redmic.es.common.utils; import java.io.BufferedReader; /*- * #%L * ElasticSearch Loading @@ -22,6 +24,7 @@ package es.redmic.es.common.utils; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; import java.lang.reflect.Field; Loading @@ -31,6 +34,7 @@ import java.util.List; import java.util.Map; import java.util.Map.Entry; import org.apache.commons.io.FileUtils; import org.apache.commons.io.IOUtils; import org.apache.lucene.search.join.ScoreMode; import org.elasticsearch.action.get.GetResponse; Loading Loading @@ -289,9 +293,7 @@ public class ElasticSearchUtils { public static String getScriptFile(String mappingFilePath) { try { InputStream resource = new ClassPathResource(mappingFilePath).getInputStream(); return IOUtils.toString(resource, Charset.forName(StandardCharsets.UTF_8.name())); return FileUtils.readFileToString(new ClassPathResource(mappingFilePath).getFile(), StandardCharsets.UTF_8); } catch (IOException e) { e.printStackTrace(); throw new ResourceNotFoundException(e); Loading