org.sonatype.aether.metadata
Interface Metadata

All Known Subinterfaces:
MergeableMetadata
All Known Implementing Classes:
DefaultMetadata, StubMetadata

public interface Metadata

A piece of repository metadata, e.g. an index of available versions. In contrast to an artifact, which usually exists in only one repository, metadata usually exists in multiple repositories and each repository contains a different copy of the metadata. Note: Metadata instances are supposed to be immutable, e.g. any exposed mutator method returns a new metadata instance and leaves the original instance unchanged. Implementors are strongly advised to obey this contract.

Author:
Benjamin Bentmann

Nested Class Summary
static class Metadata.Nature
          The nature of the metadata.
 
Method Summary
 java.lang.String getArtifactId()
          Gets the artifact identifier of this metadata.
 java.io.File getFile()
          Gets the file of this metadata.
 java.lang.String getGroupId()
          Gets the group identifier of this metadata.
 Metadata.Nature getNature()
          Gets the nature of this metadata.
 java.lang.String getType()
          Gets the type of the metadata, e.g.
 java.lang.String getVersion()
          Gets the version of this metadata.
 Metadata setFile(java.io.File file)
          Sets the file of the metadata.
 

Method Detail

getGroupId

java.lang.String getGroupId()
Gets the group identifier of this metadata.

Returns:
The group identifier or an empty string if the metadata applies to the entire repository, never null.

getArtifactId

java.lang.String getArtifactId()
Gets the artifact identifier of this metadata.

Returns:
The artifact identifier or an empty string if the metadata applies to the groupId level only, never null.

getVersion

java.lang.String getVersion()
Gets the version of this metadata.

Returns:
The version or an empty string if the metadata applies to the groupId:artifactId level only, never null.

getType

java.lang.String getType()
Gets the type of the metadata, e.g. "maven-metadata.xml".

Returns:
The type of the metadata, never null.

getNature

Metadata.Nature getNature()
Gets the nature of this metadata. The nature indicates to what artifact versions the metadata refers.

Returns:
The nature, never null.

getFile

java.io.File getFile()
Gets the file of this metadata. Note that only resolved metadata has a file associated with it.

Returns:
The file or null if none.

setFile

Metadata setFile(java.io.File file)
Sets the file of the metadata.

Parameters:
file - The file of the metadata, may be null
Returns:
The new metadata, never null.


Copyright © 2010 Sonatype, Inc.. All Rights Reserved.