+
+ }
+
+ @Override
+ public boolean exists(ProvidedSession session, String relativePath) {
+ if ("".equals(relativePath))
+ return true;
+ NodeList nodes = findContent(relativePath);
+ return nodes.getLength() != 0;
+ }
+
+ public void persist(ProvidedSession session) {
+ if (mountPath != null) {
+ Content mountPoint = session.getMountPoint(mountPath);
+ try (OutputStream out = mountPoint.open(OutputStream.class)) {
+ CmsContentRepository contentRepository = (CmsContentRepository) session.getRepository();
+ contentRepository.writeDom(document, out);
+ } catch (IOException e) {
+ throw new IllegalStateException("Cannot persist " + mountPath, e);
+ }
+ }
+ }
+
+ @Override
+ public String getMountPath() {
+ return mountPath;
+ }
+
+ public void registerPrefix(String prefix, String namespace) {
+ DomUtils.addNamespace(document.getDocumentElement(), prefix, namespace);