Class AbstractRepositoryMetadata
java.lang.Object
org.apache.maven.artifact.repository.metadata.AbstractRepositoryMetadata
- All Implemented Interfaces:
ArtifactMetadata
,RepositoryMetadata
,ArtifactMetadata
- Direct Known Subclasses:
ArtifactRepositoryMetadata
,GroupRepositoryMetadata
,SnapshotArtifactRepositoryMetadata
Shared methods of the repository metadata handling.
- Author:
- Brett Porter
-
Field Summary
Fields inherited from interface org.apache.maven.artifact.repository.metadata.RepositoryMetadata
RELEASE, RELEASE_OR_SNAPSHOT, SNAPSHOT
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected static Metadata
createMetadata
(Artifact artifact, Versioning versioning) protected static Versioning
createVersioning
(Snapshot snapshot) getLocalFilename
(ArtifactRepository repository) Get the filename of this metadata on the local repository.Get the repository metadata associated with this marker.int
Gets the artifact quality this metadata refers to.getPolicy
(ArtifactRepository repository) Gets the policy that applies to this metadata regarding the specified repository.Get the filename of this metadata on the remote repository.void
merge
(ArtifactMetadata metadata) void
merge
(ArtifactMetadata metadata) Merge a new metadata set into this piece of metadata.void
setMetadata
(Metadata metadata) Set the metadata contents.void
storeInLocalRepository
(ArtifactRepository localRepository, ArtifactRepository remoteRepository) Store the metadata in the local repository.toString()
protected void
updateRepositoryMetadata
(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
-
Constructor Details
-
AbstractRepositoryMetadata
-
-
Method Details
-
getRemoteFilename
Description copied from interface:ArtifactMetadata
Get the filename of this metadata on the remote repository.- Specified by:
getRemoteFilename
in interfaceArtifactMetadata
- Returns:
- the filename
-
getLocalFilename
Description copied from interface:ArtifactMetadata
Get the filename of this metadata on the local repository.- Specified by:
getLocalFilename
in 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:ArtifactMetadata
Store the metadata in the local repository. TODO this should only be needed on the repository metadataArtifactMetadata
- Specified by:
storeInLocalRepository
in interfaceArtifactMetadata
- Parameters:
localRepository
- the local repositoryremoteRepository
- the remote repository it came from- Throws:
RepositoryMetadataStoreException
- in case of issue
-
updateRepositoryMetadata
protected void updateRepositoryMetadata(ArtifactRepository localRepository, ArtifactRepository remoteRepository) throws IOException, org.codehaus.plexus.util.xml.pull.XmlPullParserException - Throws:
IOException
org.codehaus.plexus.util.xml.pull.XmlPullParserException
-
toString
-
createMetadata
-
createVersioning
-
setMetadata
Description copied from interface:RepositoryMetadata
Set the metadata contents.- Specified by:
setMetadata
in interfaceRepositoryMetadata
- Parameters:
metadata
- the metadata
-
getMetadata
Description copied from interface:RepositoryMetadata
Get the repository metadata associated with this marker.- Specified by:
getMetadata
in interfaceRepositoryMetadata
- Returns:
- the metadata, or
null
if none loaded
-
merge
Description copied from interface:ArtifactMetadata
Merge a new metadata set into this piece of metadata. TODO this should only be needed on the repository metadataArtifactMetadata
- Specified by:
merge
in interfaceArtifactMetadata
- Parameters:
metadata
- the new metadata
-
merge
- Specified by:
merge
in interfaceArtifactMetadata
-
extendedToString
- Specified by:
extendedToString
in interfaceArtifactMetadata
-
getNature
public int getNature()Description copied from interface:RepositoryMetadata
Gets the artifact quality this metadata refers to. One ofRepositoryMetadata.RELEASE
,RepositoryMetadata.SNAPSHOT
orRepositoryMetadata.RELEASE_OR_SNAPSHOT
.- Specified by:
getNature
in interfaceRepositoryMetadata
- Returns:
- The artifact quality this metadata refers to.
-
getPolicy
Description copied from interface:RepositoryMetadata
Gets the policy that applies to this metadata regarding the specified repository.- Specified by:
getPolicy
in interfaceRepositoryMetadata
- Parameters:
repository
- The repository for which to determine the policy, must not benull
.- Returns:
- The policy, never
null
.
-