Skip to content

Commit

Permalink
fix resource dumping on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
dfsek committed Jun 8, 2022
1 parent 6f41d16 commit d93f11b
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -244,12 +244,13 @@ protected void dumpResources() {
String resourceYaml = IOUtils.toString(resourcesConfig, StandardCharsets.UTF_8);
Map<String, List<String>> resources = new Yaml().load(resourceYaml);
resources.forEach((dir, entries) -> entries.forEach(entry -> {
String resourcePath = dir + File.separatorChar + entry;
String resourceClassPath = dir + "/" + entry;
String resourcePath = resourceClassPath.replace('/', File.separatorChar);
File resource = new File(getDataFolder(), resourcePath);
if(resource.exists())
return; // dont overwrite

try(InputStream is = getClass().getResourceAsStream("/" + resourcePath)) {
try(InputStream is = getClass().getResourceAsStream("/" + resourceClassPath)) {
if(is == null) {
logger.error("Resource {} doesn't exist on the classpath!", resourcePath);
return;
Expand Down

0 comments on commit d93f11b

Please sign in to comment.