Search in sources :

Example 1 with MavenPathParser

use of org.sonatype.nexus.repository.maven.MavenPathParser in project nexus-public by sonatype.

the class MavenIndexPublisher method prefetchIndexFiles.

/**
 * Prefetch proxy repository index files, if possible. Returns {@code true} if successful. Accepts only maven proxy
 * types. Returns {@code true} if successfully prefetched files (they exist on remote and are locally cached).
 */
public boolean prefetchIndexFiles(final Repository repository) throws IOException {
    checkNotNull(repository);
    checkArgument(ProxyType.NAME.equals(repository.getType().getValue()));
    MavenPathParser mavenPathParser = getMavenPathParser(repository);
    return prefetch(repository, INDEX_PROPERTY_FILE, mavenPathParser) && prefetch(repository, INDEX_MAIN_CHUNK_FILE, mavenPathParser);
}
Also used : MavenPathParser(org.sonatype.nexus.repository.maven.MavenPathParser)

Example 2 with MavenPathParser

use of org.sonatype.nexus.repository.maven.MavenPathParser in project nexus-public by sonatype.

the class DataStoreMavenTestHelper method deleteAll.

private void deleteAll(final MavenContentFacet mavenContentFacet, final Collection<FluentAsset> assets) {
    MavenPathParser mavenPathParser = mavenContentFacet.getMavenPathParser();
    assets.stream().map(FluentAsset::path).map(mavenPathParser::parsePath).forEach(path -> {
        try {
            mavenContentFacet.delete(path);
        } catch (IOException e) {
            e.printStackTrace();
        }
    });
}
Also used : MavenPathParser(org.sonatype.nexus.repository.maven.MavenPathParser) IOException(java.io.IOException) FluentAsset(org.sonatype.nexus.repository.content.fluent.FluentAsset)

Aggregations

MavenPathParser (org.sonatype.nexus.repository.maven.MavenPathParser)2 IOException (java.io.IOException)1 FluentAsset (org.sonatype.nexus.repository.content.fluent.FluentAsset)1