Search in sources :

Example 1 with ContentNotFoundException

use of org.apache.archiva.repository.content.ContentNotFoundException in project archiva by apache.

the class DefaultRepositoriesService method deleteProject.

@Override
public ActionStatus deleteProject(String groupId, String projectId, String repositoryId) throws ArchivaRestServiceException {
    if (StringUtils.isEmpty(repositoryId)) {
        throw new ArchivaRestServiceException("repositoryId cannot be null", 400, null);
    }
    if (!getPermissionStatus(repositoryId).isAuthorizedToDeleteArtifacts()) {
        throw new ArchivaRestServiceException("not authorized to delete artifacts", 403, null);
    }
    if (StringUtils.isEmpty(groupId)) {
        throw new ArchivaRestServiceException("groupId cannot be null", 400, null);
    }
    if (StringUtils.isEmpty(projectId)) {
        throw new ArchivaRestServiceException("artifactId cannot be null", 400, null);
    }
    RepositorySession repositorySession = null;
    try {
        repositorySession = repositorySessionFactory.createSession();
    } catch (MetadataRepositoryException e) {
        e.printStackTrace();
    }
    try {
        ManagedRepositoryContent repository = getManagedRepositoryContent(repositoryId);
        ArchivaItemSelector itemSelector = ArchivaItemSelector.builder().withNamespace(groupId).withProjectId(projectId).build();
        ContentItem item = repository.getItem(itemSelector);
        repository.deleteItem(item);
    } catch (ContentNotFoundException e) {
        log.warn("skip ContentNotFoundException: {}", e.getMessage());
    } catch (RepositoryException e) {
        log.error(e.getMessage(), e);
        throw new ArchivaRestServiceException("Repository exception: " + e.getMessage(), 500, e);
    } catch (ItemNotFoundException e) {
        log.error("Item not found {}", e.getMessage(), e);
        throw new ArchivaRestServiceException("Repository exception: " + e.getMessage(), 500, e);
    }
    try {
        MetadataRepository metadataRepository = repositorySession.getRepository();
        metadataRepository.removeProject(repositorySession, repositoryId, groupId, projectId);
        repositorySession.save();
    } catch (MetadataRepositoryException | MetadataSessionException e) {
        log.error(e.getMessage(), e);
        throw new ArchivaRestServiceException("Repository exception: " + e.getMessage(), 500, e);
    } finally {
        repositorySession.close();
    }
    return ActionStatus.SUCCESS;
}
Also used : MetadataRepositoryException(org.apache.archiva.metadata.repository.MetadataRepositoryException) ArchivaItemSelector(org.apache.archiva.repository.content.base.ArchivaItemSelector) MetadataRepository(org.apache.archiva.metadata.repository.MetadataRepository) ContentNotFoundException(org.apache.archiva.repository.content.ContentNotFoundException) ArchivaRestServiceException(org.apache.archiva.rest.api.services.ArchivaRestServiceException) ManagedRepositoryContent(org.apache.archiva.repository.ManagedRepositoryContent) RepositoryException(org.apache.archiva.repository.RepositoryException) MetadataRepositoryException(org.apache.archiva.metadata.repository.MetadataRepositoryException) RepositorySession(org.apache.archiva.metadata.repository.RepositorySession) MetadataSessionException(org.apache.archiva.metadata.repository.MetadataSessionException) ContentItem(org.apache.archiva.repository.content.ContentItem) ItemNotFoundException(org.apache.archiva.repository.content.ItemNotFoundException)

Example 2 with ContentNotFoundException

use of org.apache.archiva.repository.content.ContentNotFoundException in project archiva by apache.

the class CleanupReleasedSnapshotsRepositoryPurge method updateMetadata.

/*
     * TODO: Uses a deprecated API, but if we use the API with location string, it does not work as expected
     * -> not sure what needs to be changed here.
     */
@SuppressWarnings("deprecation")
private void updateMetadata(Artifact artifact) {
    ItemSelector versionRef = ArchivaItemSelector.builder().withNamespace(artifact.getNamespace().getId()).withProjectId(artifact.getId()).withVersion(artifact.getVersion().getId()).build();
    ItemSelector projectRef = ArchivaItemSelector.builder().withNamespace(artifact.getNamespace().getId()).withProjectId(artifact.getId()).build();
    try {
        metadataTools.updateVersionMetadata(repository, versionRef);
    } catch (ContentNotFoundException e) {
    // Ignore. (Just means we have no snapshot versions left to reference).
    } catch (RepositoryMetadataException | IOException | LayoutException e) {
    // Ignore.
    }
    try {
        metadataTools.updateProjectMetadata(repository, projectRef);
    } catch (ContentNotFoundException | RepositoryMetadataException | IOException | LayoutException e) {
    // Ignore. (Just means we have no snapshot versions left to reference).
    }
}
Also used : ArchivaItemSelector(org.apache.archiva.repository.content.base.ArchivaItemSelector) ItemSelector(org.apache.archiva.repository.content.ItemSelector) RepositoryMetadataException(org.apache.archiva.repository.metadata.RepositoryMetadataException) ContentNotFoundException(org.apache.archiva.repository.content.ContentNotFoundException) LayoutException(org.apache.archiva.repository.content.LayoutException) IOException(java.io.IOException)

Example 3 with ContentNotFoundException

use of org.apache.archiva.repository.content.ContentNotFoundException in project archiva by apache.

the class DefaultRepositoriesService method deleteArtifact.

@Override
public ActionStatus deleteArtifact(Artifact artifact) throws ArchivaRestServiceException {
    String repositoryId = artifact.getContext();
    // so try both!!
    if (StringUtils.isEmpty(repositoryId)) {
        repositoryId = artifact.getRepositoryId();
    }
    if (StringUtils.isEmpty(repositoryId)) {
        throw new ArchivaRestServiceException("repositoryId cannot be null", 400, null);
    }
    if (!getPermissionStatus(repositoryId).isAuthorizedToDeleteArtifacts()) {
        throw new ArchivaRestServiceException("not authorized to delete artifacts", 403, null);
    }
    if (artifact == null) {
        throw new ArchivaRestServiceException("artifact cannot be null", 400, null);
    }
    if (StringUtils.isEmpty(artifact.getGroupId())) {
        throw new ArchivaRestServiceException("artifact.groupId cannot be null", 400, null);
    }
    if (StringUtils.isEmpty(artifact.getArtifactId())) {
        throw new ArchivaRestServiceException("artifact.artifactId cannot be null", 400, null);
    }
    // TODO more control on artifact fields
    boolean snapshotVersion = VersionUtil.isSnapshot(artifact.getVersion()) | VersionUtil.isGenericSnapshot(artifact.getVersion());
    String baseVersion = VersionUtil.getBaseVersion(artifact.getVersion());
    RepositorySession repositorySession = null;
    try {
        repositorySession = repositorySessionFactory.createSession();
    } catch (MetadataRepositoryException e) {
        e.printStackTrace();
    }
    try {
        Date lastUpdatedTimestamp = Calendar.getInstance().getTime();
        TimeZone timezone = TimeZone.getTimeZone("UTC");
        DateFormat fmt = new SimpleDateFormat("yyyyMMdd.HHmmss");
        fmt.setTimeZone(timezone);
        ManagedRepository repo = repositoryRegistry.getManagedRepository(repositoryId);
        ManagedRepositoryContent repository = getManagedRepositoryContent(repositoryId);
        BaseRepositoryContentLayout layout = repository.getLayout(BaseRepositoryContentLayout.class);
        ArchivaItemSelector versionSelector = ArchivaItemSelector.builder().withNamespace(artifact.getGroupId()).withProjectId(artifact.getArtifactId()).withVersion(baseVersion).build();
        Version version1 = layout.getVersion(versionSelector);
        String path = repository.toPath(version1);
        ArchivaItemSelector selector = ArchivaItemSelector.builder().withNamespace(artifact.getGroupId()).withProjectId(artifact.getArtifactId()).withVersion(baseVersion).withClassifier(artifact.getClassifier()).withArtifactId(artifact.getArtifactId()).withType(artifact.getType()).includeRelatedArtifacts().build();
        MetadataRepository metadataRepository = repositorySession.getRepository();
        if (StringUtils.isNotBlank(artifact.getClassifier())) {
            if (StringUtils.isBlank(artifact.getPackaging())) {
                throw new ArchivaRestServiceException("You must configure a type/packaging when using classifier", 400, null);
            }
            List<? extends org.apache.archiva.repository.content.Artifact> artifactItems = layout.getArtifacts(selector);
            for (org.apache.archiva.repository.content.Artifact aRef : artifactItems) {
                try {
                    repository.deleteItem(aRef);
                } catch (ItemNotFoundException e) {
                    log.error("Could not delete item, seems to be deleted by other thread. {}, {} ", aRef, e.getMessage());
                }
            }
        } else {
            int index = path.lastIndexOf('/');
            path = path.substring(0, index);
            StorageAsset targetPath = repo.getAsset(path);
            if (!targetPath.exists()) {
                // throw new ContentNotFoundException(
                // artifact.getNamespace() + ":" + artifact.getArtifactId() + ":" + artifact.getVersion() );
                log.warn("targetPath {} not found skip file deletion", targetPath);
                return ActionStatus.FAIL;
            }
            // delete from file system
            if (!snapshotVersion && version1.exists()) {
                try {
                    repository.deleteItem(version1);
                } catch (ItemNotFoundException e) {
                    log.error("Could not delete version item {}", e.getMessage());
                }
            } else {
                // We are deleting all version related artifacts for a snapshot version
                for (org.apache.archiva.repository.content.Artifact delArtifact : layout.getArtifacts(selector)) {
                    try {
                        repository.deleteItem(delArtifact);
                    } catch (ItemNotFoundException e) {
                        log.warn("Artifact that should be deleted, was not found: {}", delArtifact);
                    }
                }
                StorageAsset metadataFile = getMetadata(repo, targetPath.getPath());
                ArchivaRepositoryMetadata metadata = getMetadata(repository.getRepository().getType(), metadataFile);
                updateMetadata(metadata, metadataFile, lastUpdatedTimestamp, artifact);
            }
        }
        Collection<ArtifactMetadata> artifacts = Collections.emptyList();
        if (snapshotVersion) {
            artifacts = metadataRepository.getArtifacts(repositorySession, repositoryId, artifact.getGroupId(), artifact.getArtifactId(), baseVersion);
        } else {
            artifacts = metadataRepository.getArtifacts(repositorySession, repositoryId, artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion());
        }
        log.debug("artifacts: {}", artifacts);
        if (artifacts.isEmpty()) {
            if (!snapshotVersion) {
                // verify metata repository doesn't contains anymore the version
                Collection<String> projectVersions = metadataRepository.getProjectVersions(repositorySession, repositoryId, artifact.getGroupId(), artifact.getArtifactId());
                if (projectVersions.contains(artifact.getVersion())) {
                    log.warn("artifact not found when deleted but version still here ! so force cleanup");
                    metadataRepository.removeProjectVersion(repositorySession, repositoryId, artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion());
                }
            }
        }
        for (ArtifactMetadata artifactMetadata : artifacts) {
            // TODO: mismatch between artifact (snapshot) version and project (base) version here
            if (artifactMetadata.getVersion().equals(artifact.getVersion())) {
                if (StringUtils.isNotBlank(artifact.getClassifier())) {
                    if (StringUtils.isBlank(artifact.getPackaging())) {
                        throw new ArchivaRestServiceException("You must configure a type/packaging when using classifier", 400, null);
                    }
                    // cleanup facet which contains classifier information
                    MavenArtifactFacet mavenArtifactFacet = (MavenArtifactFacet) artifactMetadata.getFacet(MavenArtifactFacet.FACET_ID);
                    if (StringUtils.equals(artifact.getClassifier(), mavenArtifactFacet.getClassifier())) {
                        artifactMetadata.removeFacet(MavenArtifactFacet.FACET_ID);
                        String groupId = artifact.getGroupId(), artifactId = artifact.getArtifactId(), version = artifact.getVersion();
                        MavenArtifactFacet mavenArtifactFacetToCompare = new MavenArtifactFacet();
                        mavenArtifactFacetToCompare.setClassifier(artifact.getClassifier());
                        metadataRepository.removeFacetFromArtifact(repositorySession, repositoryId, groupId, artifactId, version, mavenArtifactFacetToCompare);
                        repositorySession.save();
                    }
                } else {
                    if (snapshotVersion) {
                        metadataRepository.removeTimestampedArtifact(repositorySession, artifactMetadata, VersionUtil.getBaseVersion(artifact.getVersion()));
                    } else {
                        metadataRepository.removeArtifact(repositorySession, artifactMetadata.getRepositoryId(), artifactMetadata.getNamespace(), artifactMetadata.getProject(), artifact.getVersion(), artifactMetadata.getId());
                    }
                }
                // repository metadata to an artifact
                for (RepositoryListener listener : listeners) {
                    listener.deleteArtifact(metadataRepository, repository.getId(), artifactMetadata.getNamespace(), artifactMetadata.getProject(), artifactMetadata.getVersion(), artifactMetadata.getId());
                }
                triggerAuditEvent(repositoryId, path, AuditEvent.REMOVE_FILE);
            }
        }
    } catch (ContentNotFoundException e) {
        throw new ArchivaRestServiceException("Artifact does not exist: " + e.getMessage(), 400, e);
    } catch (RepositoryNotFoundException e) {
        throw new ArchivaRestServiceException("Target repository cannot be found: " + e.getMessage(), 400, e);
    } catch (RepositoryException e) {
        throw new ArchivaRestServiceException("Repository exception: " + e.getMessage(), 500, e);
    } catch (MetadataResolutionException | MetadataSessionException | MetadataRepositoryException | LayoutException e) {
        throw new ArchivaRestServiceException("Repository exception: " + e.getMessage(), 500, e);
    } finally {
        try {
            repositorySession.save();
        } catch (MetadataSessionException e) {
            log.error("Could not save sesion {}", e.getMessage());
        }
        repositorySession.close();
    }
    return ActionStatus.SUCCESS;
}
Also used : ArchivaItemSelector(org.apache.archiva.repository.content.base.ArchivaItemSelector) ManagedRepository(org.apache.archiva.repository.ManagedRepository) MavenArtifactFacet(org.apache.archiva.maven.metadata.model.MavenArtifactFacet) RepositorySession(org.apache.archiva.metadata.repository.RepositorySession) MetadataSessionException(org.apache.archiva.metadata.repository.MetadataSessionException) MetadataRepository(org.apache.archiva.metadata.repository.MetadataRepository) Version(org.apache.archiva.repository.content.Version) LayoutException(org.apache.archiva.repository.content.LayoutException) ArtifactMetadata(org.apache.archiva.metadata.model.ArtifactMetadata) MetadataRepositoryException(org.apache.archiva.metadata.repository.MetadataRepositoryException) RepositoryListener(org.apache.archiva.metadata.audit.RepositoryListener) ContentNotFoundException(org.apache.archiva.repository.content.ContentNotFoundException) RepositoryException(org.apache.archiva.repository.RepositoryException) MetadataRepositoryException(org.apache.archiva.metadata.repository.MetadataRepositoryException) RepositoryNotFoundException(org.apache.archiva.repository.RepositoryNotFoundException) Date(java.util.Date) MetadataResolutionException(org.apache.archiva.metadata.repository.MetadataResolutionException) TimeZone(java.util.TimeZone) BaseRepositoryContentLayout(org.apache.archiva.repository.content.BaseRepositoryContentLayout) ArchivaRestServiceException(org.apache.archiva.rest.api.services.ArchivaRestServiceException) DateFormat(java.text.DateFormat) SimpleDateFormat(java.text.SimpleDateFormat) StorageAsset(org.apache.archiva.repository.storage.StorageAsset) ManagedRepositoryContent(org.apache.archiva.repository.ManagedRepositoryContent) ArchivaRepositoryMetadata(org.apache.archiva.model.ArchivaRepositoryMetadata) SimpleDateFormat(java.text.SimpleDateFormat) ItemNotFoundException(org.apache.archiva.repository.content.ItemNotFoundException)

Example 4 with ContentNotFoundException

use of org.apache.archiva.repository.content.ContentNotFoundException in project archiva by apache.

the class MetadataTools method updateVersionMetadata.

/**
 * Update the metadata based on the following rules.
 * <p>
 * 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
 *
 * @param managedRepository the managed repository where the metadata is kept.
 * @param reference         the versioned reference to update
 * @throws LayoutException
 * @throws RepositoryMetadataException
 * @throws IOException
 * @throws ContentNotFoundException
 * @deprecated
 */
public void updateVersionMetadata(ManagedRepositoryContent managedRepository, ItemSelector reference) throws LayoutException, RepositoryMetadataException, IOException, ContentNotFoundException {
    StorageAsset metadataFile = managedRepository.getRepository().getAsset(toPath(reference));
    ArchivaRepositoryMetadata existingMetadata = readMetadataFile(managedRepository, metadataFile);
    long lastUpdated = getExistingLastUpdated(existingMetadata);
    ArchivaRepositoryMetadata metadata = new ArchivaRepositoryMetadata();
    metadata.setGroupId(reference.getNamespace());
    metadata.setArtifactId(reference.getArtifactId());
    if (VersionUtil.isSnapshot(reference.getVersion())) {
        // Do SNAPSHOT handling.
        metadata.setVersion(VersionUtil.getBaseVersion(reference.getVersion()));
        // Gather up all of the versions found in the reference dir, and any
        // proxied maven-metadata.xml files.
        Set<String> snapshotVersions = gatherSnapshotVersions(managedRepository, reference);
        if (snapshotVersions.isEmpty()) {
            throw new ContentNotFoundException("No snapshot versions found on reference [" + reference + "].");
        }
        // sort the list to determine to aide in determining the Latest version.
        List<String> sortedVersions = new ArrayList<>();
        sortedVersions.addAll(snapshotVersions);
        Collections.sort(sortedVersions, new VersionComparator());
        String latestVersion = sortedVersions.get(sortedVersions.size() - 1);
        if (VersionUtil.isUniqueSnapshot(latestVersion)) {
            // The latestVersion will contain the full version string "1.0-alpha-5-20070821.213044-8"
            // This needs to be broken down into ${base}-${timestamp}-${build_number}
            Matcher m = VersionUtil.UNIQUE_SNAPSHOT_PATTERN.matcher(latestVersion);
            if (m.matches()) {
                metadata.setSnapshotVersion(new SnapshotVersion());
                int buildNumber = NumberUtils.toInt(m.group(3), -1);
                metadata.getSnapshotVersion().setBuildNumber(buildNumber);
                Matcher mtimestamp = VersionUtil.TIMESTAMP_PATTERN.matcher(m.group(2));
                if (mtimestamp.matches()) {
                    String tsDate = mtimestamp.group(1);
                    String tsTime = mtimestamp.group(2);
                    long snapshotLastUpdated = toLastUpdatedLong(tsDate + tsTime);
                    lastUpdated = Math.max(lastUpdated, snapshotLastUpdated);
                    metadata.getSnapshotVersion().setTimestamp(m.group(2));
                }
            }
        } else if (VersionUtil.isGenericSnapshot(latestVersion)) {
            // The latestVersion ends with the generic version string.
            // Example: 1.0-alpha-5-SNAPSHOT
            metadata.setSnapshotVersion(new SnapshotVersion());
        /* Disabled due to decision in [MRM-535].
                 * Do not set metadata.lastUpdated to file.lastModified.
                 *
                 * Should this be the last updated timestamp of the file, or in the case of an
                 * archive, the most recent timestamp in the archive?
                 *
                ArtifactReference artifact = getFirstArtifact( managedRepository, reference );

                if ( artifact == null )
                {
                    throw new IOException( "Not snapshot artifact found to reference in " + reference );
                }

                File artifactFile = managedRepository.toFile( artifact );

                if ( artifactFile.exists() )
                {
                    Date lastModified = new Date( artifactFile.lastModified() );
                    metadata.setLastUpdatedTimestamp( lastModified );
                }
                */
        } else {
            throw new RepositoryMetadataException("Unable to process snapshot version <" + latestVersion + "> reference <" + reference + ">");
        }
    } else {
        // Do RELEASE handling.
        metadata.setVersion(reference.getVersion());
    }
    // Set last updated
    if (lastUpdated > 0) {
        metadata.setLastUpdatedTimestamp(toLastUpdatedDate(lastUpdated));
    }
    // Save the metadata model to disk.
    RepositoryMetadataWriter.write(metadata, metadataFile);
    ChecksummedFile checksum = new ChecksummedFile(metadataFile.getFilePath());
    checksum.fixChecksums(algorithms);
}
Also used : ContentNotFoundException(org.apache.archiva.repository.content.ContentNotFoundException) Matcher(java.util.regex.Matcher) ArrayList(java.util.ArrayList) ChecksummedFile(org.apache.archiva.checksum.ChecksummedFile) RepositoryMetadataException(org.apache.archiva.repository.metadata.RepositoryMetadataException) SnapshotVersion(org.apache.archiva.model.SnapshotVersion) StorageAsset(org.apache.archiva.repository.storage.StorageAsset) VersionComparator(org.apache.archiva.common.utils.VersionComparator) ArchivaRepositoryMetadata(org.apache.archiva.model.ArchivaRepositoryMetadata)

Example 5 with ContentNotFoundException

use of org.apache.archiva.repository.content.ContentNotFoundException in project archiva by apache.

the class MetadataTools method gatherSnapshotVersions.

/**
 * Gather the set of snapshot versions found in a particular versioned reference.
 *
 * @return the Set of snapshot artifact versions found.
 * @throws LayoutException
 * @throws ContentNotFoundException
 */
public Set<String> gatherSnapshotVersions(ManagedRepositoryContent managedRepository, ItemSelector reference) throws LayoutException, IOException, ContentNotFoundException {
    Set<String> foundVersions = null;
    try {
        ArchivaItemSelector selector = ArchivaItemSelector.builder().withNamespace(reference.getNamespace()).withProjectId(reference.getArtifactId()).withArtifactId(reference.getArtifactId()).withVersion(reference.getVersion()).build();
        try (Stream<? extends Artifact> stream = managedRepository.getLayout(BaseRepositoryContentLayout.class).newArtifactStream(selector)) {
            foundVersions = stream.map(a -> a.getArtifactVersion()).filter(StringUtils::isNotEmpty).collect(Collectors.toSet());
        }
    } catch (ContentAccessException e) {
        log.error("Error while accessing content {}", e.getMessage());
        throw new IOException("Could not access repository content: " + e.getMessage());
    }
    // Next gather up the referenced 'latest' versions found in any proxied repositories
    // maven-metadata-${proxyId}.xml files that may be present.
    // Does this repository have a set of remote proxied repositories?
    Set<String> proxiedRepoIds = this.proxies.get(managedRepository.getId());
    if (CollectionUtils.isNotEmpty(proxiedRepoIds)) {
        String baseVersion = VersionUtil.getBaseVersion(reference.getVersion());
        baseVersion = baseVersion.substring(0, baseVersion.indexOf(VersionUtil.SNAPSHOT) - 1);
        // Add in the proxied repo version ids too.
        Iterator<String> it = proxiedRepoIds.iterator();
        while (it.hasNext()) {
            String proxyId = it.next();
            ArchivaRepositoryMetadata proxyMetadata = readProxyMetadata(managedRepository, reference, proxyId);
            if (proxyMetadata == null) {
                // There is no proxy metadata, skip it.
                continue;
            }
            // Is there some snapshot info?
            SnapshotVersion snapshot = proxyMetadata.getSnapshotVersion();
            if (snapshot != null) {
                String timestamp = snapshot.getTimestamp();
                int buildNumber = snapshot.getBuildNumber();
                // Only interested in the timestamp + buildnumber.
                if (StringUtils.isNotBlank(timestamp) && (buildNumber > 0)) {
                    foundVersions.add(baseVersion + "-" + timestamp + "-" + buildNumber);
                }
            }
        }
    }
    return foundVersions;
}
Also used : Arrays(java.util.Arrays) ConfigurationListener(org.apache.archiva.configuration.provider.ConfigurationListener) ArchivaRepositoryMetadata(org.apache.archiva.model.ArchivaRepositoryMetadata) Date(java.util.Date) StorageAsset(org.apache.archiva.repository.storage.StorageAsset) LoggerFactory(org.slf4j.LoggerFactory) StringUtils(org.apache.commons.lang3.StringUtils) RegistryListener(org.apache.archiva.components.registry.RegistryListener) Matcher(java.util.regex.Matcher) Map(java.util.Map) ItemSelector(org.apache.archiva.repository.content.ItemSelector) ConfigurationEvent(org.apache.archiva.configuration.provider.ConfigurationEvent) ParseException(java.text.ParseException) ContentItem(org.apache.archiva.repository.content.ContentItem) RemoteRepositoryContent(org.apache.archiva.repository.RemoteRepositoryContent) FileTypes(org.apache.archiva.configuration.provider.FileTypes) TimeZone(java.util.TimeZone) Collection(java.util.Collection) RepositoryRegistry(org.apache.archiva.repository.RepositoryRegistry) Set(java.util.Set) Collectors(java.util.stream.Collectors) Plugin(org.apache.archiva.model.Plugin) List(java.util.List) Stream(java.util.stream.Stream) PostConstruct(javax.annotation.PostConstruct) BaseRepositoryContentLayout(org.apache.archiva.repository.content.BaseRepositoryContentLayout) Artifact(org.apache.archiva.repository.content.Artifact) ArchivaConfiguration(org.apache.archiva.configuration.provider.ArchivaConfiguration) ConfigurationNames(org.apache.archiva.configuration.model.ConfigurationNames) ArchivaItemSelector(org.apache.archiva.repository.content.base.ArchivaItemSelector) SimpleDateFormat(java.text.SimpleDateFormat) HashMap(java.util.HashMap) CollectionUtils(org.apache.commons.collections4.CollectionUtils) ArrayList(java.util.ArrayList) Inject(javax.inject.Inject) HashSet(java.util.HashSet) ProxyConnectorConfiguration(org.apache.archiva.configuration.model.ProxyConnectorConfiguration) Calendar(java.util.Calendar) Service(org.springframework.stereotype.Service) ChecksumAlgorithm(org.apache.archiva.checksum.ChecksumAlgorithm) RepositoryMetadataException(org.apache.archiva.repository.metadata.RepositoryMetadataException) Named(javax.inject.Named) VersionComparator(org.apache.archiva.common.utils.VersionComparator) LinkedHashSet(java.util.LinkedHashSet) ManagedRepositoryContent(org.apache.archiva.repository.ManagedRepositoryContent) SnapshotVersion(org.apache.archiva.model.SnapshotVersion) ContentAccessException(org.apache.archiva.repository.content.ContentAccessException) Project(org.apache.archiva.repository.content.Project) Logger(org.slf4j.Logger) Iterator(java.util.Iterator) ContentNotFoundException(org.apache.archiva.repository.content.ContentNotFoundException) VersionUtil(org.apache.archiva.common.utils.VersionUtil) IOException(java.io.IOException) RepositoryType(org.apache.archiva.repository.RepositoryType) ChecksummedFile(org.apache.archiva.checksum.ChecksummedFile) Registry(org.apache.archiva.components.registry.Registry) MetadataReader(org.apache.archiva.repository.metadata.MetadataReader) NumberUtils(org.apache.commons.lang3.math.NumberUtils) LayoutException(org.apache.archiva.repository.content.LayoutException) Collections(java.util.Collections) ArchivaItemSelector(org.apache.archiva.repository.content.base.ArchivaItemSelector) IOException(java.io.IOException) BaseRepositoryContentLayout(org.apache.archiva.repository.content.BaseRepositoryContentLayout) StringUtils(org.apache.commons.lang3.StringUtils) SnapshotVersion(org.apache.archiva.model.SnapshotVersion) ArchivaRepositoryMetadata(org.apache.archiva.model.ArchivaRepositoryMetadata) ContentAccessException(org.apache.archiva.repository.content.ContentAccessException)

Aggregations

ContentNotFoundException (org.apache.archiva.repository.content.ContentNotFoundException)5 ArchivaRepositoryMetadata (org.apache.archiva.model.ArchivaRepositoryMetadata)3 ArchivaItemSelector (org.apache.archiva.repository.content.base.ArchivaItemSelector)3 RepositoryMetadataException (org.apache.archiva.repository.metadata.RepositoryMetadataException)3 StorageAsset (org.apache.archiva.repository.storage.StorageAsset)3 IOException (java.io.IOException)2 SimpleDateFormat (java.text.SimpleDateFormat)2 ArrayList (java.util.ArrayList)2 Date (java.util.Date)2 TimeZone (java.util.TimeZone)2 Matcher (java.util.regex.Matcher)2 ChecksummedFile (org.apache.archiva.checksum.ChecksummedFile)2 VersionComparator (org.apache.archiva.common.utils.VersionComparator)2 MetadataRepository (org.apache.archiva.metadata.repository.MetadataRepository)2 MetadataRepositoryException (org.apache.archiva.metadata.repository.MetadataRepositoryException)2 MetadataSessionException (org.apache.archiva.metadata.repository.MetadataSessionException)2 RepositorySession (org.apache.archiva.metadata.repository.RepositorySession)2 SnapshotVersion (org.apache.archiva.model.SnapshotVersion)2 ManagedRepositoryContent (org.apache.archiva.repository.ManagedRepositoryContent)2 RepositoryException (org.apache.archiva.repository.RepositoryException)2