This project has retired. For details please refer to its Attic page.
MetadataTools

org.apache.maven.archiva.repository.metadata
Class MetadataTools

Package class diagram package MetadataTools
java.lang.Object
  extended by org.apache.maven.archiva.repository.metadata.MetadataTools
All Implemented Interfaces:
org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable, org.codehaus.plexus.registry.RegistryListener

public class MetadataTools
extends java.lang.Object
implements org.codehaus.plexus.registry.RegistryListener, org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable

MetadataTools


Field Summary
static java.lang.String MAVEN_METADATA
           
 
Constructor Summary
MetadataTools()
           
 
Method Summary
 void afterConfigurationChange(org.codehaus.plexus.registry.Registry registry, java.lang.String propertyName, java.lang.Object propertyValue)
           
 void beforeConfigurationChange(org.codehaus.plexus.registry.Registry registry, java.lang.String propertyName, java.lang.Object propertyValue)
           
 java.util.Set<java.lang.String> gatherSnapshotVersions(ManagedRepositoryContent managedRepository, org.apache.maven.archiva.model.VersionedReference reference)
          Gather the set of snapshot versions found in a particular versioned reference.
 org.apache.maven.archiva.model.ArtifactReference getFirstArtifact(ManagedRepositoryContent managedRepository, org.apache.maven.archiva.model.VersionedReference reference)
          Get the first Artifact found in the provided VersionedReference location.
 java.lang.String getRepositorySpecificName(RemoteRepositoryContent repository, java.lang.String path)
          Adjusts a path for a metadata.xml file to its repository specific path.
 java.lang.String getRepositorySpecificName(java.lang.String proxyId, java.lang.String path)
          Adjusts a path for a metadata.xml file to its repository specific path.
 void initialize()
           
 org.apache.maven.archiva.model.ArchivaRepositoryMetadata readProxyMetadata(ManagedRepositoryContent managedRepository, org.apache.maven.archiva.model.ProjectReference reference, java.lang.String proxyId)
           
 org.apache.maven.archiva.model.ArchivaRepositoryMetadata readProxyMetadata(ManagedRepositoryContent managedRepository, java.lang.String logicalResource, java.lang.String proxyId)
           
 org.apache.maven.archiva.model.ArchivaRepositoryMetadata readProxyMetadata(ManagedRepositoryContent managedRepository, org.apache.maven.archiva.model.VersionedReference reference, java.lang.String proxyId)
           
 java.lang.String toPath(org.apache.maven.archiva.model.ProjectReference reference)
           
 java.lang.String toPath(org.apache.maven.archiva.model.VersionedReference reference)
           
 org.apache.maven.archiva.model.ProjectReference toProjectReference(java.lang.String path)
           
 org.apache.maven.archiva.model.VersionedReference toVersionedReference(java.lang.String path)
          Take a path to a maven-metadata.xml, and attempt to translate it to a VersionedReference.
 void updateMetadata(ManagedRepositoryContent managedRepository, org.apache.maven.archiva.model.ProjectReference reference)
          Deprecated.  
 void updateMetadata(ManagedRepositoryContent managedRepository, java.lang.String logicalResource)
           
 void updateMetadata(ManagedRepositoryContent managedRepository, org.apache.maven.archiva.model.VersionedReference reference)
          Deprecated.  
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAVEN_METADATA

public static final java.lang.String MAVEN_METADATA
See Also:
Constant Field Values
Constructor Detail

MetadataTools

public MetadataTools()
Method Detail

afterConfigurationChange

public void afterConfigurationChange(org.codehaus.plexus.registry.Registry registry,
                                     java.lang.String propertyName,
                                     java.lang.Object propertyValue)
Specified by:
afterConfigurationChange in interface org.codehaus.plexus.registry.RegistryListener

beforeConfigurationChange

public void beforeConfigurationChange(org.codehaus.plexus.registry.Registry registry,
                                      java.lang.String propertyName,
                                      java.lang.Object propertyValue)
Specified by:
beforeConfigurationChange in interface org.codehaus.plexus.registry.RegistryListener

gatherSnapshotVersions

public java.util.Set<java.lang.String> gatherSnapshotVersions(ManagedRepositoryContent managedRepository,
                                                              org.apache.maven.archiva.model.VersionedReference reference)
                                                       throws LayoutException,
                                                              java.io.IOException,
                                                              ContentNotFoundException
Gather the set of snapshot versions found in a particular versioned reference.

Returns:
the Set of snapshot artifact versions found.
Throws:
LayoutException
ContentNotFoundException
java.io.IOException

toVersionedReference

public org.apache.maven.archiva.model.VersionedReference toVersionedReference(java.lang.String path)
                                                                       throws RepositoryMetadataException
Take a path to a maven-metadata.xml, and attempt to translate it to a VersionedReference.

Parameters:
path -
Returns:
Throws:
RepositoryMetadataException

toProjectReference

public org.apache.maven.archiva.model.ProjectReference toProjectReference(java.lang.String path)
                                                                   throws RepositoryMetadataException
Throws:
RepositoryMetadataException

toPath

public java.lang.String toPath(org.apache.maven.archiva.model.ProjectReference reference)

toPath

public java.lang.String toPath(org.apache.maven.archiva.model.VersionedReference reference)

getRepositorySpecificName

public java.lang.String getRepositorySpecificName(RemoteRepositoryContent repository,
                                                  java.lang.String path)
Adjusts a path for a metadata.xml file to its repository specific path.

Parameters:
repository - the repository to base new path off of.
path - the path to the metadata.xml file to adjust the name of.
Returns:
the newly adjusted path reference to the repository specific metadata path.

getRepositorySpecificName

public java.lang.String getRepositorySpecificName(java.lang.String proxyId,
                                                  java.lang.String path)
Adjusts a path for a metadata.xml file to its repository specific path.

Parameters:
proxyId - the repository id to base new path off of.
path - the path to the metadata.xml file to adjust the name of.
Returns:
the newly adjusted path reference to the repository specific metadata path.

initialize

public void initialize()
                throws org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException
Specified by:
initialize in interface org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable
Throws:
org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException

readProxyMetadata

public org.apache.maven.archiva.model.ArchivaRepositoryMetadata readProxyMetadata(ManagedRepositoryContent managedRepository,
                                                                                  org.apache.maven.archiva.model.ProjectReference reference,
                                                                                  java.lang.String proxyId)

readProxyMetadata

public org.apache.maven.archiva.model.ArchivaRepositoryMetadata readProxyMetadata(ManagedRepositoryContent managedRepository,
                                                                                  java.lang.String logicalResource,
                                                                                  java.lang.String proxyId)

readProxyMetadata

public org.apache.maven.archiva.model.ArchivaRepositoryMetadata readProxyMetadata(ManagedRepositoryContent managedRepository,
                                                                                  org.apache.maven.archiva.model.VersionedReference reference,
                                                                                  java.lang.String proxyId)

updateMetadata

public void updateMetadata(ManagedRepositoryContent managedRepository,
                           java.lang.String logicalResource)
                    throws RepositoryMetadataException
Throws:
RepositoryMetadataException

updateMetadata

public void updateMetadata(ManagedRepositoryContent managedRepository,
                           org.apache.maven.archiva.model.ProjectReference reference)
                    throws LayoutException,
                           RepositoryMetadataException,
                           java.io.IOException,
                           ContentNotFoundException
Deprecated. 

Update the metadata to represent the all versions/plugins of the provided groupId:artifactId project or group reference, based off of information present in the repository, the maven-metadata.xml files, and the proxy/repository specific metadata file contents. We must treat this as a group or a project metadata file as there is no way to know in advance

Parameters:
managedRepository - the managed repository where the metadata is kept.
reference - the reference to update.
Throws:
LayoutException
RepositoryMetadataException
java.io.IOException
ContentNotFoundException

updateMetadata

public void updateMetadata(ManagedRepositoryContent managedRepository,
                           org.apache.maven.archiva.model.VersionedReference reference)
                    throws LayoutException,
                           RepositoryMetadataException,
                           java.io.IOException,
                           ContentNotFoundException
Deprecated. 

Update the metadata based on the following rules.

1) If this is a SNAPSHOT reference, then utilize the proxy/repository specific metadata files to represent the current / latest SNAPSHOT available. 2) If this is a RELEASE reference, and the metadata file does not exist, then create the metadata file with contents required of the VersionedReference

Parameters:
managedRepository - the managed repository where the metadata is kept.
reference - the versioned reference to update
Throws:
LayoutException
RepositoryMetadataException
java.io.IOException
ContentNotFoundException

getFirstArtifact

public org.apache.maven.archiva.model.ArtifactReference getFirstArtifact(ManagedRepositoryContent managedRepository,
                                                                         org.apache.maven.archiva.model.VersionedReference reference)
                                                                  throws LayoutException,
                                                                         java.io.IOException
Get the first Artifact found in the provided VersionedReference location.

Parameters:
managedRepository - the repository to search within.
reference - the reference to the versioned reference to search within
Returns:
the ArtifactReference to the first artifact located within the versioned reference. or null if no artifact was found within the versioned reference.
Throws:
java.io.IOException - if the versioned reference is invalid (example: doesn't exist, or isn't a directory)
LayoutException