/*
 * Copyright to the original author or authors
 *
 * 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.rioproject.url.artifact;

import org.rioproject.resolver.RemoteRepository;

import java.util.ArrayList;
import java.util.List;

/**
 * Holds the attributes of a URL of type <code>artifact</code>
 *
 * @author Dennis Reedy
 */
public class ArtifactURLConfiguration {
    private String artifact;
    private final List<RemoteRepository> repositories = new ArrayList<RemoteRepository>();

    public ArtifactURLConfiguration(String path) {
        int index = path.indexOf(";");
        if(index!=-1) {
            String repoString = path.substring(index+1, path.length());
            path = path.substring(0, index);
            String[] parts = repoString.split(";");
            for(String s : parts) {
                RemoteRepository r = new RemoteRepository();
                r.setUrl(s);
                repositories.add(r);
            }
        }
        artifact = path.replaceAll("/", ":");
    }

    public String getArtifact() {
        return artifact;
    }

    public RemoteRepository[] getRepositories() {
        return repositories.toArray(new RemoteRepository[repositories.size()]);
    }
}

@@ -812,16 +812,216 @@
 t%3C/code%3E
+.%0A *%0A * %3Cp%3EThe URL scheme that the %7B@code ArtifactURLConfiguration%7D decomposes is as follows:%3Cbr/%3E%0A * %3Cpre%3Eartifact:groupId/artifactId/version%5B/type%5B/classifier%5D%5D%5B;%5BrepositoryId@%5Drepository%5D%3C/pre%3E%3C/p%3E
 %0A *%0A * @
@@ -1338,24 +1338,30 @@
  String repo
+sitory
 String = pat
@@ -1475,16 +1475,22 @@
 s = repo
+sitory
 String.s
@@ -1532,24 +1532,335 @@
  : parts) %7B%0A
+                String url;%0A                String id = null;%0A                String%5B%5D subParts = s.split(%22@%22);%0A                if(subParts.length%3E1) %7B%0A                    id = subParts%5B0%5D;%0A                    url = subParts%5B1%5D;%0A                %7D else %7B%0A                    url = subParts%5B0%5D;%0A                %7D%0A
             
@@ -1933,17 +1933,48 @@
 .setUrl(
-s
+url);%0A                r.setId(id
 );%0A     

Add support for parsing the repository id.