mirror of
https://github.com/spring-projects/spring-data-elasticsearch.git
synced 2025-06-22 03:52:10 +00:00
DATAES-883 - Fix log level on resource load error.
Original PR: #493 (cherry picked from commit 0f940b36d7a89257694ed85639f1a89c4eb2a35a)
This commit is contained in:
parent
0a2038505f
commit
6462305521
@ -38,8 +38,8 @@ public abstract class ResourceUtil {
|
|||||||
/**
|
/**
|
||||||
* Read a {@link ClassPathResource} into a {@link String}.
|
* Read a {@link ClassPathResource} into a {@link String}.
|
||||||
*
|
*
|
||||||
* @param url
|
* @param url url the file url
|
||||||
* @return
|
* @return the contents of the file or null if it could not be read
|
||||||
*/
|
*/
|
||||||
@Nullable
|
@Nullable
|
||||||
public static String readFileFromClasspath(String url) {
|
public static String readFileFromClasspath(String url) {
|
||||||
@ -48,7 +48,7 @@ public abstract class ResourceUtil {
|
|||||||
try (InputStream is = classPathResource.getInputStream()) {
|
try (InputStream is = classPathResource.getInputStream()) {
|
||||||
return StreamUtils.copyToString(is, Charset.defaultCharset());
|
return StreamUtils.copyToString(is, Charset.defaultCharset());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LOGGER.debug(String.format("Failed to load file from url: %s: %s", url, e.getMessage()));
|
LOGGER.warn(String.format("Failed to load file from url: %s: %s", url, e.getMessage()));
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user