Skip to content

Commit d93f11b

Browse files
committed
fix resource dumping on windows
1 parent 6f41d16 commit d93f11b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

common/implementation/base/src/main/java/com/dfsek/terra/AbstractPlatform.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,12 +244,13 @@ protected void dumpResources() {
244244
String resourceYaml = IOUtils.toString(resourcesConfig, StandardCharsets.UTF_8);
245245
Map<String, List<String>> resources = new Yaml().load(resourceYaml);
246246
resources.forEach((dir, entries) -> entries.forEach(entry -> {
247-
String resourcePath = dir + File.separatorChar + entry;
247+
String resourceClassPath = dir + "/" + entry;
248+
String resourcePath = resourceClassPath.replace('/', File.separatorChar);
248249
File resource = new File(getDataFolder(), resourcePath);
249250
if(resource.exists())
250251
return; // dont overwrite
251252

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

0 commit comments

Comments
 (0)