mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-10-26 22:10:22 +00:00
create addon dir if it doesn't exist
This commit is contained in:
1 parent
e89d473669
commit
fa66bd3c42
1 file changed
+12
-9
+12
-9
@@ -80,15 +80,18 @@ public class BootstrapAddonLoader implements BootstrapBaseAddon<BootstrapBaseAdd
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Iterable<BootstrapBaseAddon<?>> loadAddons(Path addonsFolder, BootstrapAddonClassLoader parent) {
|
public Iterable<BootstrapBaseAddon<?>> loadAddons(Path addonsFolder, BootstrapAddonClassLoader parent) {
|
||||||
Path bootstrapFolder = addonsFolder.resolve("bootstrap");
|
try {
|
||||||
logger.debug("Loading bootstrap addons from {}", bootstrapFolder);
|
Path bootstrapFolder = addonsFolder.resolve("bootstrap");
|
||||||
|
Files.createDirectories(bootstrapFolder);
|
||||||
try(Stream<Path> bootstrapAddons = Files.walk(bootstrapFolder, 1, FileVisitOption.FOLLOW_LINKS)) {
|
logger.debug("Loading bootstrap addons from {}", bootstrapFolder);
|
||||||
return bootstrapAddons.filter(path -> path.toFile().isFile())
|
|
||||||
.filter(path -> path.toFile().canRead())
|
try(Stream<Path> bootstrapAddons = Files.walk(bootstrapFolder, 1, FileVisitOption.FOLLOW_LINKS)) {
|
||||||
.filter(path -> path.toString().endsWith(".jar"))
|
return bootstrapAddons.filter(path -> path.toFile().isFile())
|
||||||
.map(path -> loadAddon(path, parent))
|
.filter(path -> path.toFile().canRead())
|
||||||
.collect(Collectors.toList());
|
.filter(path -> path.toString().endsWith(".jar"))
|
||||||
|
.map(path -> loadAddon(path, parent))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
} catch(IOException e) {
|
} catch(IOException e) {
|
||||||
throw new UncheckedIOException(e);
|
throw new UncheckedIOException(e);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user