if (illegalPlugin(legalPlugs, listener.name())) {
LOGGER.debug("plugin " + listener.name() + " is not legal for render");
continue;
}
if (listener instanceof AdditionalFolderAtRoot) {
AdditionalFolderAtRoot afar = (AdditionalFolderAtRoot) listener;
try {
DLNAResource resource = afar.getChild();
LOGGER.debug("add ext list " + listener);
if (resource == null) {
continue;
}
resource.setMasterParent(listener);
for (DLNAResource r : resource.getChildren()) {
r.setMasterParent(listener);
}
res.add(resource);
} catch (Throwable t) {
LOGGER.error(String.format("Failed to append AdditionalFolderAtRoot with name=%s, class=%s", afar.name(), afar.getClass()), t);
}
} else if (listener instanceof AdditionalFoldersAtRoot) {
Iterator<DLNAResource> folders = ((AdditionalFoldersAtRoot) listener).getChildren();
while (folders.hasNext()) {