artifact.getGroupId());
}
JcrUtils.updateLastModifiedAndParents(groupBase,
- RepoConstants.ARTIFACTS_BASE_PATH);
+ RepoConstants.DEFAULT_ARTIFACTS_BASE_PATH);
if (log.isTraceEnabled())
log.trace("Indexed artifact " + artifact + " on " + fileNode);
}
private String getRelativePath(String nodePath) {
- String basePath = RepoConstants.ARTIFACTS_BASE_PATH;
+ String basePath = RepoConstants.DEFAULT_ARTIFACTS_BASE_PATH;
if (!nodePath.startsWith(basePath))
return null;
String relativePath = nodePath.substring(basePath.length());
/** SLC repository constants */
public interface RepoConstants {
- public final static String ARTIFACTS_BASE_PATH = "/";
+ public final static String DEFAULT_ARTIFACTS_BASE_PATH = "/";
public final static String REPO_BASEPATH = "/slc:repo";
public final static String PROXIED_REPOSITORIES = REPO_BASEPATH
+ "/slc:sources";
.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";
private Repository repository;
private String workspace;
- private String artifactBasePath = RepoConstants.ARTIFACTS_BASE_PATH;
+ private String artifactBasePath = RepoConstants.DEFAULT_ARTIFACTS_BASE_PATH;
private ArtifactIndexer artifactIndexer = new ArtifactIndexer();
private JarFileIndexer jarFileIndexer = new JarFileIndexer();
private Repository repository;
private String workspace;
- private String artifactBasePath = RepoConstants.ARTIFACTS_BASE_PATH;
+ private String artifactBasePath = RepoConstants.DEFAULT_ARTIFACTS_BASE_PATH;
private String distributionsBasePath = RepoConstants.DISTRIBUTIONS_BASE_PATH;
private String distributionName;
private List<RemoteRepository> defaultRepositories = new ArrayList<RemoteRepository>();
- private boolean rootNodeIsArtifactBase = RepoConstants.ARTIFACTS_BASE_PATH
- .equals("/");
+ private String artifactsBasePath = RepoConstants.DEFAULT_ARTIFACTS_BASE_PATH;
/** Inititalizes the artifacts area. */
@Override
protected void beforeInitSessionSave(Session session)
throws RepositoryException {
- JcrUtils.mkdirsSafe(session, RepoConstants.ARTIFACTS_BASE_PATH);
+ JcrUtils.mkdirsSafe(session, RepoConstants.DEFAULT_ARTIFACTS_BASE_PATH);
Node proxiedRepositories = JcrUtils.mkdirsSafe(session,
RepoConstants.PROXIED_REPOSITORIES);
for (RemoteRepository repository : defaultRepositories) {
/** The JCR path where this file could be found */
public String getNodePath(String path) {
- if (rootNodeIsArtifactBase)
+ if (artifactsBasePath.equals(RepoConstants.DEFAULT_ARTIFACTS_BASE_PATH))
return path;
else
- return RepoConstants.ARTIFACTS_BASE_PATH + path;
+ return artifactsBasePath + path;
}
public void setDefaultRepositories(
this.defaultRepositories = defaultRepositories;
}
+ public void setArtifactsBasePath(String artifactsBasePath) {
+ this.artifactsBasePath = artifactsBasePath;
+ }
+
}