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