Skip to content

Commit

Permalink
[core]make classpath:/config/ is first scan sureness.yml path
Browse files Browse the repository at this point in the history
  • Loading branch information
tomsun28 committed Feb 18, 2022
1 parent cf3dec9 commit b1facdd
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,12 @@ public static DocumentResourceEntity loadConfig(String yamlFileName) throws IOEx
Yaml yaml = new Yaml();
InputStream inputStream = null;
try {
inputStream = DocumentResourceAccess.class.getClassLoader().getResourceAsStream(yamlFileName);
// 1. classpath:/config/
// 2. classpath: /
inputStream = DocumentResourceAccess.class.getClassLoader().getResourceAsStream("config/" + yamlFileName);
if (inputStream == null) {
inputStream = DocumentResourceAccess.class.getClassLoader().getResourceAsStream(yamlFileName);
}
if (inputStream == null) {
inputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream(yamlFileName);
}
Expand Down

0 comments on commit b1facdd

Please sign in to comment.