add leniency for tests

This commit is contained in:
Robert Muir 2015-12-03 23:25:36 -05:00
parent f2cebd9b3b
commit 208b46d94b
1 changed files with 4 additions and 0 deletions

View File

@ -276,6 +276,10 @@ public class PluginsService extends AbstractComponent {
// similar in impl to getPluginBundles, but DO NOT try to make them share code. // similar in impl to getPluginBundles, but DO NOT try to make them share code.
// we don't need to inherit all the leniency, and things are different enough. // we don't need to inherit all the leniency, and things are different enough.
static List<Bundle> getModuleBundles(Path modulesDirectory) throws IOException { static List<Bundle> getModuleBundles(Path modulesDirectory) throws IOException {
// damn leniency
if (Files.notExists(modulesDirectory)) {
return Collections.emptyList();
}
List<Bundle> bundles = new ArrayList<>(); List<Bundle> bundles = new ArrayList<>();
try (DirectoryStream<Path> stream = Files.newDirectoryStream(modulesDirectory)) { try (DirectoryStream<Path> stream = Files.newDirectoryStream(modulesDirectory)) {
for (Path module : stream) { for (Path module : stream) {