X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=runtime%2Forg.argeo.slc.repo%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fslc%2Frepo%2FRepoImpl.java;h=265530f895402c8f2aa918a5276d12c11d1fa1eb;hb=e70fb767d8ff5972d88ab436762e71ea622a0f72;hp=9951b33bad122590e436f97f0d0765eb347067d7;hpb=912cf5554a61dc35fb61183da39673656b668467;p=gpl%2Fargeo-slc.git diff --git a/runtime/org.argeo.slc.repo/src/main/java/org/argeo/slc/repo/RepoImpl.java b/runtime/org.argeo.slc.repo/src/main/java/org/argeo/slc/repo/RepoImpl.java index 9951b33ba..265530f89 100644 --- a/runtime/org.argeo.slc.repo/src/main/java/org/argeo/slc/repo/RepoImpl.java +++ b/runtime/org.argeo.slc.repo/src/main/java/org/argeo/slc/repo/RepoImpl.java @@ -1,6 +1,22 @@ +/* + * Copyright (C) 2007-2012 Argeo GmbH + * + * 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.slc.repo; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import javax.jcr.Node; @@ -33,8 +49,14 @@ public class RepoImpl { .getWorkspace() .getObservationManager() .addEventListener(artifactListener, Event.NODE_ADDED, - RepoConstants.ARTIFACTS_BASE_PATH, true, null, + RepoConstants.DEFAULT_ARTIFACTS_BASE_PATH, true, null, null, true); + // localrepo + String localrepoWorkspace = "localrepo"; + if (!Arrays.asList( + adminSession.getWorkspace().getAccessibleWorkspaceNames()) + .contains(localrepoWorkspace)) + adminSession.getWorkspace().createWorkspace(localrepoWorkspace); } catch (RepositoryException e) { throw new SlcException("Cannot initialize repository backend", e); }