mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-08-27 12:31:29 +00:00
fix resource dumping on windows
This commit is contained in:
@@ -244,12 +244,13 @@ public abstract class AbstractPlatform implements Platform {
|
|||||||
String resourceYaml = IOUtils.toString(resourcesConfig, StandardCharsets.UTF_8);
|
String resourceYaml = IOUtils.toString(resourcesConfig, StandardCharsets.UTF_8);
|
||||||
Map<String, List<String>> resources = new Yaml().load(resourceYaml);
|
Map<String, List<String>> resources = new Yaml().load(resourceYaml);
|
||||||
resources.forEach((dir, entries) -> entries.forEach(entry -> {
|
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);
|
File resource = new File(getDataFolder(), resourcePath);
|
||||||
if(resource.exists())
|
if(resource.exists())
|
||||||
return; // dont overwrite
|
return; // dont overwrite
|
||||||
|
|
||||||
try(InputStream is = getClass().getResourceAsStream("/" + resourcePath)) {
|
try(InputStream is = getClass().getResourceAsStream("/" + resourceClassPath)) {
|
||||||
if(is == null) {
|
if(is == null) {
|
||||||
logger.error("Resource {} doesn't exist on the classpath!", resourcePath);
|
logger.error("Resource {} doesn't exist on the classpath!", resourcePath);
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user