|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.dpml.transit.Artifact
A utility class the handles validation of artifact
style uri
strings.
Field Summary | |
static String |
ARTIFACT
Constant scheme name for the artifact protocol. |
static String |
LINK
Constant scheme name for the link protocol. |
static String |
LOCAL
Constant scheme name for the local protocol. |
Method Summary | |
int |
compareTo(Object object)
Compare this artifact with another artifact. |
static Artifact |
createArtifact(String uri)
Creation of a new artifact instance using a supplied uri specification. |
static Artifact |
createArtifact(String group,
String name,
String version,
String type)
Creation of a new artifact instance using a supplied group, name, version and type arguments. |
static Artifact |
createArtifact(String scheme,
String group,
String name,
String version,
String type)
Creation of a new artifact instance using a supplied group, name, version and type arguments. |
static Artifact |
createArtifact(URI uri)
Creation of a new artifact instance using a supplied uri specification. |
boolean |
equals(Object other)
Compare this artifact with the supplied object for equality. |
String |
getGroup()
Return the group identifier for the artifact. |
String |
getName()
Return the name of the artifact. |
String |
getScheme()
Return the protocol for the artifact. |
String |
getType()
Return the type of the artifact. |
String |
getVersion()
Return the posssibly null version identifier. |
int |
hashCode()
Return the hashcode for the artifact. |
boolean |
isRecognized()
Test if the artifact scheme is recognized. |
static boolean |
isRecognized(URI uri)
Test if the supplied uri is from the artifact family. |
String |
toString()
Return a string representation of the artifact. |
URI |
toURI()
Create an artifact url backed by the repository. |
URL |
toURL()
Create an artifact url backed by the repository. |
static URL |
toURL(URI uri)
Construct a new URL form a given URI. |
URL |
toURL(URLStreamHandler handler)
Create an artifact url backed by the repository. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final String ARTIFACT
public static final String LINK
public static final String LOCAL
Method Detail |
public static final Artifact createArtifact(String uri) throws URISyntaxException, UnsupportedSchemeException
The following represent valid artifact uri examples:
If there is a internal reference identifier which is marked by the exclamation mark followed by slash (!/) it will be stripped. The version part can be either before or after such identifier. Example;
artifact:war:jmx-html/jmx-html#1.3!/images/abc.png artifact:war:jmx-html/jmx-html!/images/abc.png#1.3The above uris will both be referencing
artifact:war:jmx-html/jmx-html#1.3
uri
- the artifact uri
URISyntaxException
- if the supplied uri is not valid.
UnsupportedSchemeException
- if the URI does not have "artifact"
or "link" as its scheme.public static final Artifact createArtifact(URI uri) throws UnsupportedSchemeException
The following represent valid artifact uri examples:
uri
- the artifact uri
UnsupportedSchemeException
- if the URI does not have "artifact"
or "link" as its scheme.public static Artifact createArtifact(String group, String name, String version, String type) throws NullArgumentException
group
- the artifact group identifiername
- the artifact nameversion
- the versiontype
- the type
NullArgumentException
- if any of the group
,
name
or type
arguments are
null
.public static Artifact createArtifact(String scheme, String group, String name, String version, String type) throws NullArgumentException
scheme
- the artifact schemegroup
- the artifact group identifiername
- the artifact nameversion
- the versiontype
- the type
NullArgumentException
- if any of the group
,
name
or type
arguments are
null
.public static URL toURL(URI uri) throws MalformedURLException
uri
- the uri to convert
MalformedURLException
- if the url could not be createdpublic static boolean isRecognized(URI uri)
uri
- the uri to check
public final String getScheme()
public final String getGroup()
public final String getName()
public final String getType()
public final String getVersion()
public boolean isRecognized()
public URL toURL()
public URL toURL(URLStreamHandler handler)
handler
- the protocol handler
public URI toURI()
public int compareTo(Object object) throws NullArgumentException, ClassCastException
compareTo
in interface Comparable
object
- the object to compare with this instance
NullArgumentException
- if the supplied object argument is null.
ClassCastException
- if the supplied object is not an Artifact.public String toString()
public boolean equals(Object other)
other
- the object to compare with this instance
public int hashCode()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |