use of org.sonatype.nexus.common.time.DateHelper in project nexus-public by sonatype.
the class DataStoreMavenTestHelper method getLastDownloadedTime.
@Override
public DateTime getLastDownloadedTime(final Repository repository, final String assetPath) throws IOException {
MavenContentFacet mavenContentFacet = repository.facet(MavenContentFacet.class);
MavenPath mavenPath = mavenContentFacet.getMavenPathParser().parsePath(assetPath);
return mavenContentFacet.get(mavenPath).map(Content::getAttributes).map(attributes -> attributes.get(Asset.class)).map(Asset::lastDownloaded).filter(Optional::isPresent).map(Optional::get).map(DateHelper::toDateTime).orElse(null);
}
Aggregations