}
return contexts.get(0).toContext();
}
private Context getContext(String path, boolean create) {
Context c = getContext();
if (c == null) {
return null;
}
Context parent = null;
for (String pathElem : new ContextPath(path).getElements()) {
parent = c;
c = c.getChild(pathElem);
if (c == null) {
if (!create) {
return null;
}
c = parent.createChild(pathElem);
}
}
return c;
}