- /** The JCR path where this file could be found */
- public String getNodePath(String path) {
- return RepoConstants.ARTIFACTS_BASE_PATH + path;
- }
-
- protected Node importFile(String nodePath, InputStream in) {
- Binary binary = null;
- try {
- Node node = JcrUtils.mkdirs(jcrAdminSession, nodePath,
- NodeType.NT_FILE, NodeType.NT_FOLDER, false);
- Node content = node.addNode(Node.JCR_CONTENT, NodeType.NT_RESOURCE);
- binary = jcrAdminSession.getValueFactory().createBinary(in);
- content.setProperty(Property.JCR_DATA, binary);
- jcrAdminSession.save();
- return node;
- } catch (RepositoryException e) {
- JcrUtils.discardQuietly(jcrAdminSession);
- throw new SlcException("Cannot initialize Maven proxy", e);
- } finally {
- JcrUtils.closeQuietly(binary);
+ protected synchronized List<Node> getBaseUrls(Session session)
+ throws RepositoryException {
+ List<Node> baseUrls = new ArrayList<Node>();
+ for (NodeIterator nit = session.getNode(
+ RepoConstants.PROXIED_REPOSITORIES).getNodes(); nit.hasNext();) {
+ Node proxiedRepository = nit.nextNode();
+ baseUrls.add(proxiedRepository);