Class AbstractRepositoryMetadata
- java.lang.Object
-
- org.apache.maven.artifact.repository.metadata.AbstractRepositoryMetadata
-
- All Implemented Interfaces:
ArtifactMetadata,RepositoryMetadata,ArtifactMetadata
- Direct Known Subclasses:
ArtifactRepositoryMetadata,GroupRepositoryMetadata,SnapshotArtifactRepositoryMetadata
public abstract class AbstractRepositoryMetadata extends java.lang.Object implements RepositoryMetadata
Shared methods of the repository metadata handling.
-
-
Field Summary
Fields Modifier and Type Field Description private Metadatametadata-
Fields inherited from interface org.apache.maven.artifact.repository.metadata.RepositoryMetadata
RELEASE, RELEASE_OR_SNAPSHOT, SNAPSHOT
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractRepositoryMetadata(Metadata metadata)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static MetadatacreateMetadata(Artifact artifact, Versioning versioning)protected static VersioningcreateVersioning(Snapshot snapshot)java.lang.StringextendedToString()java.lang.StringgetLocalFilename(ArtifactRepository repository)Get the filename of this metadata on the local repository.MetadatagetMetadata()Get the repository metadata associated with this marker.intgetNature()Gets the artifact quality this metadata refers to.ArtifactRepositoryPolicygetPolicy(ArtifactRepository repository)Gets the policy that applies to this metadata regarding the specified repository.java.lang.StringgetRemoteFilename()Get the filename of this metadata on the remote repository.voidmerge(ArtifactMetadata metadata)voidmerge(ArtifactMetadata metadata)Merge a new metadata set into this piece of metadata.voidsetMetadata(Metadata metadata)Set the metadata contents.voidstoreInLocalRepository(ArtifactRepository localRepository, ArtifactRepository remoteRepository)Store the metadata in the local repository.java.lang.StringtoString()protected voidupdateRepositoryMetadata(ArtifactRepository localRepository, ArtifactRepository remoteRepository)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.maven.repository.legacy.metadata.ArtifactMetadata
getArtifactId, getBaseVersion, getGroupId, getKey, storedInArtifactVersionDirectory, storedInGroupDirectory
-
Methods inherited from interface org.apache.maven.artifact.repository.metadata.RepositoryMetadata
getRepository, isSnapshot, setRepository
-
-
-
-
Field Detail
-
metadata
private Metadata metadata
-
-
Constructor Detail
-
AbstractRepositoryMetadata
protected AbstractRepositoryMetadata(Metadata metadata)
-
-
Method Detail
-
getRemoteFilename
public java.lang.String getRemoteFilename()
Description copied from interface:ArtifactMetadataGet the filename of this metadata on the remote repository.- Specified by:
getRemoteFilenamein interfaceArtifactMetadata- Returns:
- the filename
-
getLocalFilename
public java.lang.String getLocalFilename(ArtifactRepository repository)
Description copied from interface:ArtifactMetadataGet the filename of this metadata on the local repository.- Specified by:
getLocalFilenamein interfaceArtifactMetadata- Parameters:
repository- the remote repository it came from- Returns:
- the filename
-
storeInLocalRepository
public void storeInLocalRepository(ArtifactRepository localRepository, ArtifactRepository remoteRepository) throws RepositoryMetadataStoreException
Description copied from interface:ArtifactMetadataStore the metadata in the local repository.- Specified by:
storeInLocalRepositoryin interfaceArtifactMetadata- Parameters:
localRepository- the local repositoryremoteRepository- the remote repository it came from TODO this should only be needed on the repository metadata- Throws:
RepositoryMetadataStoreException
-
updateRepositoryMetadata
protected void updateRepositoryMetadata(ArtifactRepository localRepository, ArtifactRepository remoteRepository) throws java.io.IOException, org.codehaus.plexus.util.xml.pull.XmlPullParserException
- Throws:
java.io.IOExceptionorg.codehaus.plexus.util.xml.pull.XmlPullParserException
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
createMetadata
protected static Metadata createMetadata(Artifact artifact, Versioning versioning)
-
createVersioning
protected static Versioning createVersioning(Snapshot snapshot)
-
setMetadata
public void setMetadata(Metadata metadata)
Description copied from interface:RepositoryMetadataSet the metadata contents.- Specified by:
setMetadatain interfaceRepositoryMetadata- Parameters:
metadata- the metadata
-
getMetadata
public Metadata getMetadata()
Description copied from interface:RepositoryMetadataGet the repository metadata associated with this marker.- Specified by:
getMetadatain interfaceRepositoryMetadata- Returns:
- the metadata, or
nullif none loaded
-
merge
public void merge(ArtifactMetadata metadata)
Description copied from interface:ArtifactMetadataMerge a new metadata set into this piece of metadata.- Specified by:
mergein interfaceArtifactMetadata- Parameters:
metadata- the new metadata TODO this should only be needed on the repository metadata
-
merge
public void merge(ArtifactMetadata metadata)
- Specified by:
mergein interfaceArtifactMetadata
-
extendedToString
public java.lang.String extendedToString()
- Specified by:
extendedToStringin interfaceArtifactMetadata
-
getNature
public int getNature()
Description copied from interface:RepositoryMetadataGets the artifact quality this metadata refers to. One ofRepositoryMetadata.RELEASE,RepositoryMetadata.SNAPSHOTorRepositoryMetadata.RELEASE_OR_SNAPSHOT.- Specified by:
getNaturein interfaceRepositoryMetadata- Returns:
- The artifact quality this metadata refers to.
-
getPolicy
public ArtifactRepositoryPolicy getPolicy(ArtifactRepository repository)
Description copied from interface:RepositoryMetadataGets the policy that applies to this metadata regarding the specified repository.- Specified by:
getPolicyin interfaceRepositoryMetadata- Parameters:
repository- The repository for which to determine the policy, must not benull.- Returns:
- The policy, never
null.
-
-