Package org.glassfish.spec
Class Artifact
- java.lang.Object
-
- org.glassfish.spec.Artifact
-
public final class Artifact extends java.lang.Object
Represent the API JAR file as a Maven artifact.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
artifactId
Artifact artifactId.private java.lang.String
groupId
Artifact groupId.private static java.lang.String
RC_QUALIFIER
The Release Candidate qualifier.private static java.lang.String
SNAPSHOT_QUALIFIER
The Maven SNAPSHOT qualifier.private org.apache.maven.artifact.versioning.ArtifactVersion
version
Artifact version.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
static Artifact
fromJar(java.util.jar.JarFile jar)
Create anArtifact
instance from a given JAR file.java.lang.String
getAbsoluteVersion()
Get the normalized release version for this artifact.java.lang.String
getArtifactId()
Get the artifactId for this artifact.java.lang.String
getGroupId()
Get the groupId for this artifact.private static java.util.zip.ZipEntry
getPomPropertiesFile(java.util.jar.JarFile jar)
Get theZipEntry
forpom.properties
in the given JAR file.org.apache.maven.artifact.versioning.ArtifactVersion
getVersion()
Get the version for this artifact.int
hashCode()
void
setArtifactId(java.lang.String aId)
Set the artifactId of this artifact.void
setGroupId(java.lang.String gId)
Set the groupId of this artifact.void
setVersion(java.lang.String v)
Set the version of this artifact.static java.lang.String
stripSnapshotOrRcQualifier(java.lang.String version)
Strip the SNAPSHOT or RC qualifier from a given version.java.lang.String
toString()
-
-
-
Field Detail
-
groupId
private java.lang.String groupId
Artifact groupId.
-
artifactId
private java.lang.String artifactId
Artifact artifactId.
-
version
private org.apache.maven.artifact.versioning.ArtifactVersion version
Artifact version.
-
SNAPSHOT_QUALIFIER
private static final java.lang.String SNAPSHOT_QUALIFIER
The Maven SNAPSHOT qualifier.- See Also:
- Constant Field Values
-
RC_QUALIFIER
private static final java.lang.String RC_QUALIFIER
The Release Candidate qualifier.- See Also:
- Constant Field Values
-
-
Method Detail
-
stripSnapshotOrRcQualifier
public static java.lang.String stripSnapshotOrRcQualifier(java.lang.String version)
Strip the SNAPSHOT or RC qualifier from a given version.- Parameters:
version
- the qualifier to process- Returns:
- a non SNAPSHOT or RC version
-
getArtifactId
public java.lang.String getArtifactId()
Get the artifactId for this artifact.- Returns:
- the artifactId
-
getGroupId
public java.lang.String getGroupId()
Get the groupId for this artifact.- Returns:
- the groupId
-
getVersion
public org.apache.maven.artifact.versioning.ArtifactVersion getVersion()
Get the version for this artifact.- Returns:
- the version
-
getAbsoluteVersion
public java.lang.String getAbsoluteVersion()
Get the normalized release version for this artifact.- Returns:
- the version
-
setArtifactId
public void setArtifactId(java.lang.String aId)
Set the artifactId of this artifact.- Parameters:
aId
- the artifactId value to use
-
setGroupId
public void setGroupId(java.lang.String gId)
Set the groupId of this artifact.- Parameters:
gId
- the artifactId value to use
-
setVersion
public void setVersion(java.lang.String v)
Set the version of this artifact.- Parameters:
v
- the artifactId value to use
-
getPomPropertiesFile
private static java.util.zip.ZipEntry getPomPropertiesFile(java.util.jar.JarFile jar)
Get theZipEntry
forpom.properties
in the given JAR file.- Parameters:
jar
- the jar file to process- Returns:
- the
ZipEntry
if found,null
otherwise
-
fromJar
public static Artifact fromJar(java.util.jar.JarFile jar) throws java.io.IOException
Create anArtifact
instance from a given JAR file.- Parameters:
jar
- the jar file to process- Returns:
- the create
Artifact
instance - Throws:
java.io.IOException
- if an error occurs while reading JAR file entries
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-