+/*
+ * Copyright (C) 2010 Mathieu Baudier <mbaudier@argeo.org>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package org.argeo.server.jackrabbit;
import java.io.File;
import javax.jcr.Repository;
import javax.jcr.RepositoryException;
import javax.jcr.Session;
+import javax.jcr.Value;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.core.io.Resource;
+/**
+ * Wrapper around a Jackrabbit repository which allows to configure it in Spring
+ * and expose it as a {@link Repository}.
+ */
public class JackrabbitContainer implements InitializingBean, DisposableBean,
Repository {
private Log log = LogFactory.getLog(JackrabbitContainer.class);
RepositoryConfig config;
InputStream in = configuration.getInputStream();
try {
- config = RepositoryConfig.create(in, homeDirectory
- .getCanonicalPath());
+ config = RepositoryConfig.create(in,
+ homeDirectory.getCanonicalPath());
} catch (Exception e) {
throw new RuntimeException("Cannot read configuration", e);
} finally {
return repository.login(workspaceName);
}
+ public boolean isStandardDescriptor(String key) {
+ return repository.isStandardDescriptor(key);
+ }
+
+ public boolean isSingleValueDescriptor(String key) {
+ return repository.isSingleValueDescriptor(key);
+ }
+
+ public Value getDescriptorValue(String key) {
+ return repository.getDescriptorValue(key);
+ }
+
+ public Value[] getDescriptorValues(String key) {
+ return repository.getDescriptorValues(key);
+ }
+
// BEANS METHODS
public void setHomeDirectory(File homeDirectory) {
this.homeDirectory = homeDirectory;