@Service(value="metadataTools#default") public class MetadataTools extends Object implements org.apache.archiva.components.registry.RegistryListener
| Modifier and Type | Field and Description |
|---|---|
static String |
MAVEN_ARCHETYPE_CATALOG |
static String |
MAVEN_METADATA |
| Constructor and Description |
|---|
MetadataTools() |
| Modifier and Type | Method and Description |
|---|---|
void |
afterConfigurationChange(org.apache.archiva.components.registry.Registry registry,
String propertyName,
Object propertyValue) |
void |
beforeConfigurationChange(org.apache.archiva.components.registry.Registry registry,
String propertyName,
Object propertyValue) |
Set<String> |
gatherSnapshotVersions(ManagedRepositoryContent managedRepository,
VersionedReference reference)
Gather the set of snapshot versions found in a particular versioned reference.
|
ArchivaConfiguration |
getConfiguration() |
FileTypes |
getFiletypes() |
ArtifactReference |
getFirstArtifact(ManagedRepositoryContent managedRepository,
VersionedReference reference)
Get the first Artifact found in the provided VersionedReference location.
|
String |
getRepositorySpecificName(RemoteRepositoryContent repository,
String path)
Adjusts a path for a metadata.xml file to its repository specific path.
|
String |
getRepositorySpecificName(String proxyId,
String path)
Adjusts a path for a metadata.xml file to its repository specific path.
|
void |
initialize() |
ArchivaRepositoryMetadata |
readProxyMetadata(ManagedRepositoryContent managedRepository,
ProjectReference reference,
String proxyId) |
ArchivaRepositoryMetadata |
readProxyMetadata(ManagedRepositoryContent managedRepository,
String logicalResource,
String proxyId) |
ArchivaRepositoryMetadata |
readProxyMetadata(ManagedRepositoryContent managedRepository,
VersionedReference reference,
String proxyId) |
void |
setConfiguration(ArchivaConfiguration configuration) |
void |
setFiletypes(FileTypes filetypes) |
String |
toPath(ProjectReference reference) |
String |
toPath(VersionedReference reference) |
ProjectReference |
toProjectReference(String path) |
VersionedReference |
toVersionedReference(String path)
Take a path to a maven-metadata.xml, and attempt to translate it to a VersionedReference.
|
void |
updateMetadata(ManagedRepositoryContent managedRepository,
ProjectReference reference)
Deprecated.
|
void |
updateMetadata(ManagedRepositoryContent managedRepository,
String logicalResource) |
void |
updateMetadata(ManagedRepositoryContent managedRepository,
VersionedReference reference)
Deprecated.
|
public static final String MAVEN_METADATA
public static final String MAVEN_ARCHETYPE_CATALOG
public MetadataTools()
public void afterConfigurationChange(org.apache.archiva.components.registry.Registry registry, String propertyName, Object propertyValue)
afterConfigurationChange in interface org.apache.archiva.components.registry.RegistryListenerpublic void beforeConfigurationChange(org.apache.archiva.components.registry.Registry registry, String propertyName, Object propertyValue)
beforeConfigurationChange in interface org.apache.archiva.components.registry.RegistryListenerpublic Set<String> gatherSnapshotVersions(ManagedRepositoryContent managedRepository, VersionedReference reference) throws LayoutException, IOException, ContentNotFoundException
LayoutExceptionContentNotFoundExceptionIOExceptionpublic VersionedReference toVersionedReference(String path) throws RepositoryMetadataException
path - RepositoryMetadataExceptionpublic ProjectReference toProjectReference(String path) throws RepositoryMetadataException
RepositoryMetadataExceptionpublic String toPath(ProjectReference reference)
public String toPath(VersionedReference reference)
public String getRepositorySpecificName(RemoteRepositoryContent repository, String path)
repository - the repository to base new path off of.path - the path to the metadata.xml file to adjust the name of.public String getRepositorySpecificName(String proxyId, String path)
proxyId - the repository id to base new path off of.path - the path to the metadata.xml file to adjust the name of.@PostConstruct public void initialize()
public ArchivaRepositoryMetadata readProxyMetadata(ManagedRepositoryContent managedRepository, ProjectReference reference, String proxyId)
public ArchivaRepositoryMetadata readProxyMetadata(ManagedRepositoryContent managedRepository, String logicalResource, String proxyId)
public ArchivaRepositoryMetadata readProxyMetadata(ManagedRepositoryContent managedRepository, VersionedReference reference, String proxyId)
public void updateMetadata(ManagedRepositoryContent managedRepository, String logicalResource) throws RepositoryMetadataException
RepositoryMetadataExceptionpublic void updateMetadata(ManagedRepositoryContent managedRepository, ProjectReference reference) throws LayoutException, RepositoryMetadataException, IOException, ContentNotFoundException
We must treat this as a group or a project metadata file as there is no way to know in advance
managedRepository - the managed repository where the metadata is kept.reference - the reference to update.LayoutExceptionRepositoryMetadataExceptionIOExceptionContentNotFoundExceptionpublic void updateMetadata(ManagedRepositoryContent managedRepository, VersionedReference reference) throws LayoutException, RepositoryMetadataException, IOException, ContentNotFoundException
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
managedRepository - the managed repository where the metadata is kept.reference - the versioned reference to updateLayoutExceptionRepositoryMetadataExceptionIOExceptionContentNotFoundExceptionpublic ArtifactReference getFirstArtifact(ManagedRepositoryContent managedRepository, VersionedReference reference) throws LayoutException, IOException
managedRepository - the repository to search within.reference - the reference to the versioned reference to search withinIOException - if the versioned reference is invalid (example: doesn't exist, or isn't a directory)LayoutExceptionpublic ArchivaConfiguration getConfiguration()
public void setConfiguration(ArchivaConfiguration configuration)
public FileTypes getFiletypes()
public void setFiletypes(FileTypes filetypes)
Copyright © 2006–2019 The Apache Software Foundation. All rights reserved.