if (this.loaded) {
return;
}
Node repoNode = getRepositoryNode();
try {
repoNode.setPersistable(this);
// lastModified check is necessary for clustering, but can cause 404s
// because of the 1s file system last modification granularity
if (repoNode.exists() /* && repoNode.getLastModified() > this.lastModified */) {
long lastModified = repoNode.getLastModified();
org.w3c.dom.Document xml = DocumentHelper.readDocument(repoNode.getInputStream());
NamespaceHelper helper = new NamespaceHelper(NAMESPACE, "", xml);
Assert.isTrue("document element is site", xml.getDocumentElement().getLocalName()
.equals("site"));
this.loading = true;
reset();
loadNodes(this.root, helper, xml.getDocumentElement());
this.loading = false;
this.lastModified = lastModified;
}
if (!repoNode.exists() && this.lastModified > -1) {
reset();
this.lastModified = -1;
}
this.loaded = true;