case LIFECYCLE:
if ("login".equals(resourceId) || "logout".equals(resourceId)) {
ByteArrayOutputStream buffer = new ByteArrayOutputStream();
long timestamp = Long.MIN_VALUE;
for (File path : dirs) {
File f = path.child(resourceId + ".groovy");
if (f != null) {
Resource sub = f.getResource();
if (sub != null) {
buffer.write(sub.getContent());
buffer.write('\n');
timestamp = Math.max(timestamp, sub.getTimestamp());
}
}
}
return Collections.singleton(new Resource(resourceId + ".groovy", buffer.toByteArray(), timestamp));
}
break;
case COMMAND:
// Find the resource first, we find for the first found
for (File path : dirs) {
File f = path.child(resourceId);
if (f != null) {
return Collections.singleton(f.getResource());
}
}
break;
case CONFIG:
String path = "/" + resourceId;
File file = confFS.get(Path.get(path));
if (file != null) {
return Collections.singleton(loadConf(file));
}
}
} catch (IOException e) {