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);
}
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();
}
});
}
Aggregations