mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2025-07-01 23:47:50 +00:00
graceful fallback if resource cannot be loaded
This commit is contained in:
parent
ccb8adec10
commit
86d34347db
@ -111,8 +111,12 @@ public abstract class AbstractPlatform implements Platform {
|
||||
logger.info("Loading config.yml");
|
||||
File configFile = new File(getDataFolder(), "config.yml");
|
||||
if(!configFile.exists()) {
|
||||
logger.info("Writing new config.yml...");
|
||||
FileUtils.copyInputStreamToFile(stream, configFile);
|
||||
logger.info("Dumping config.yml...");
|
||||
if(stream == null) {
|
||||
logger.warn("Could not find config.yml in JAR");
|
||||
} else {
|
||||
FileUtils.copyInputStreamToFile(stream, configFile);
|
||||
}
|
||||
}
|
||||
} catch(IOException e) {
|
||||
logger.error("Error loading config.yml resource from jar", e);
|
||||
|
Loading…
x
Reference in New Issue
Block a user