KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > inversoft > savant > URLBuilder


1 /*
2  * Copyright (c) 2003-2004, Inversoft, All Rights Reserved
3  *
4  * This software is distribuable under the GNU Lesser General Public License.
5  * For more information visit gnu.org.
6  */

7 package com.inversoft.savant;
8
9
10 import java.io.File JavaDoc;
11 import java.net.URL JavaDoc;
12
13
14 /**
15  * <p>
16  * This interface describes the method by which URLs are
17  * constructred for artifacts. Given an artifact, an
18  * implementation of this class will generate a URL that
19  * can be contacted to attempt to retrieve the artifact.
20  * </p>
21  *
22  * @author Brian Pontarelli
23  */

24 public interface URLBuilder {
25
26     /**
27      * Attempts to builds a URL for the given artifact.
28      *
29      * @param artifact The artifact to build the URL for
30      * @param defaultDomain The default domain URL specification (base URL)
31      * @param mapping A Mapping file that can be used to map groups to base URLs
32      * to override the default
33      * @return The URL or null if one could not be built
34      */

35     URL JavaDoc buildURL(String JavaDoc defaultDomain, File JavaDoc mapping, Artifact artifact)
36     throws SavantException;
37
38     /**
39      * Attempts to builds a URL to the MD5 hash for the given artifact.
40      *
41      * @param artifact The artifact to build the URL for
42      * @param defaultDomain The default domain URL specification (base URL)
43      * @param mapping A Mapping file that can be used to map groups to base URLs
44      * to override the default
45      * @return The MD5 URL or null if one could not be built
46      */

47     URL JavaDoc buildMD5URL(String JavaDoc defaultDomain, File JavaDoc mapping, Artifact artifact)
48     throws SavantException;
49
50     /**
51      * Attempts to builds a URL to the XML dependency meta-data for the given
52      * artifact.
53      *
54      * @param artifact The artifact to build the URL for
55      * @param defaultDomain The default domain URL specification (base URL)
56      * @param mapping A Mapping file that can be used to map groups to base URLs
57      * to override the default
58      * @return The XML dependency URL or null if one could not be built
59      */

60     URL JavaDoc buildDepsURL(String JavaDoc defaultDomain, File JavaDoc mapping, Artifact artifact)
61     throws SavantException;
62 }
Popular Tags