Search in sources :

Example 1 with ArtifactMappingProvider

use of org.apache.archiva.metadata.repository.storage.maven2.ArtifactMappingProvider in project archiva by apache.

the class AbstractDefaultRepositoryContent method constructId.

// TODO: move into the Maven Artifact facet when refactoring away the caller - the caller will need to have access
// to the facet or filename (for the original ID)
private String constructId(String artifactId, String version, String classifier, String type) {
    String ext = null;
    for (ArtifactMappingProvider provider : artifactMappingProviders) {
        ext = provider.mapTypeToExtension(type);
        if (ext != null) {
            break;
        }
    }
    if (ext == null) {
        ext = type;
    }
    StringBuilder id = new StringBuilder();
    if ((version != null) && (type != null)) {
        id.append(artifactId).append(ARTIFACT_SEPARATOR).append(version);
        if (StringUtils.isNotBlank(classifier)) {
            id.append(ARTIFACT_SEPARATOR).append(classifier);
        }
        id.append(".").append(ext);
    }
    return id.toString();
}
Also used : ArtifactMappingProvider(org.apache.archiva.metadata.repository.storage.maven2.ArtifactMappingProvider)

Aggregations

ArtifactMappingProvider (org.apache.archiva.metadata.repository.storage.maven2.ArtifactMappingProvider)1