use of org.apache.archiva.repository.content.LayoutRuntimeException in project archiva by apache.
the class ManagedDefaultRepositoryContent method createArtifactFromPath.
private Artifact createArtifactFromPath(final StorageAsset artifactPath) throws LayoutRuntimeException {
if (artifactPath == null) {
throw new LayoutRuntimeException("Path null is not valid for artifact");
}
final Version version;
try {
version = getVersionFromArtifactPath(artifactPath);
} catch (LayoutException e) {
throw new LayoutRuntimeException(e.getMessage(), e);
}
final ArtifactInfo info = getArtifactInfoFromPath(version.getId(), artifactPath);
return org.apache.archiva.repository.content.base.ArchivaArtifact.withAsset(artifactPath).withVersion(version).withId(info.id).withClassifier(info.classifier).withRemainder(info.remainder).withType(info.type).withArtifactVersion(info.version).withContentType(info.contentType).withArtifactType(info.artifactType).build();
}
Aggregations