mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-10-27 14:30:23 +00:00
warn about nonexistent classpath resources
This commit is contained in:
1 parent
098cb740dd
commit
c811fd31b1
1 file changed
+4
@@ -291,6 +291,10 @@ public abstract class AbstractPlatform implements Platform {
|
|||||||
logger.debug("Copying resource {}", resourcePath);
|
logger.debug("Copying resource {}", resourcePath);
|
||||||
try(InputStream is = getClass().getResourceAsStream("/" + resourcePath);
|
try(InputStream is = getClass().getResourceAsStream("/" + resourcePath);
|
||||||
OutputStream os = new FileOutputStream(resource)) {
|
OutputStream os = new FileOutputStream(resource)) {
|
||||||
|
if(is == null) {
|
||||||
|
logger.error("Resource {} doesn't exist on the classpath!", resourcePath);
|
||||||
|
return;
|
||||||
|
}
|
||||||
IOUtils.copy(is, os);
|
IOUtils.copy(is, os);
|
||||||
} catch(IOException e) {
|
} catch(IOException e) {
|
||||||
throw new UncheckedIOException(e);
|
throw new UncheckedIOException(e);
|
||||||
|
|||||||
Reference in new issue
Block a user