Package org.glassfish.spec
Class Artifact
- java.lang.Object
-
- org.glassfish.spec.Artifact
-
public final class Artifact extends java.lang.ObjectRepresent the API JAR file as a Maven artifact.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringartifactIdArtifact artifactId.private java.lang.StringgroupIdArtifact groupId.private static java.lang.StringRC_QUALIFIERThe Release Candidate qualifier.private static java.lang.StringSNAPSHOT_QUALIFIERThe Maven SNAPSHOT qualifier.private org.apache.maven.artifact.versioning.ArtifactVersionversionArtifact version.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)static ArtifactfromJar(java.util.jar.JarFile jar)Create anArtifactinstance from a given JAR file.java.lang.StringgetAbsoluteVersion()Get the normalized release version for this artifact.java.lang.StringgetArtifactId()Get the artifactId for this artifact.java.lang.StringgetGroupId()Get the groupId for this artifact.private static java.util.zip.ZipEntrygetPomPropertiesFile(java.util.jar.JarFile jar)Get theZipEntryforpom.propertiesin the given JAR file.org.apache.maven.artifact.versioning.ArtifactVersiongetVersion()Get the version for this artifact.inthashCode()voidsetArtifactId(java.lang.String aId)Set the artifactId of this artifact.voidsetGroupId(java.lang.String gId)Set the groupId of this artifact.voidsetVersion(java.lang.String v)Set the version of this artifact.static java.lang.StringstripSnapshotOrRcQualifier(java.lang.String version)Strip the SNAPSHOT or RC qualifier from a given version.java.lang.StringtoString()
-
-
-
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 theZipEntryforpom.propertiesin the given JAR file.- Parameters:
jar- the jar file to process- Returns:
- the
ZipEntryif found,nullotherwise
-
fromJar
public static Artifact fromJar(java.util.jar.JarFile jar) throws java.io.IOException
Create anArtifactinstance from a given JAR file.- Parameters:
jar- the jar file to process- Returns:
- the create
Artifactinstance - Throws:
java.io.IOException- if an error occurs while reading JAR file entries
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-