use of org.commonjava.storage.pathmapped.util.PathMapUtils.ROOT_DIR in project indy by Commonjava.
the class PathMappedMavenGACache method scan.
/**
* Scan the stores to find all GAs.
* @param notScanned
* @param gaMap
* @param completed
*/
private void scan(final Collection<String> notScanned, final Map<String, Set<String>> gaMap, final Set<String> completed) {
PathDB pathDB = pathMappedFileManager.getPathDB();
notScanned.forEach(storeName -> {
Set<String> gaSet = new HashSet<>();
pathDB.traverse("maven:hosted:" + storeName, ROOT_DIR, pathMap -> {
String gaPath = getGAPath(pathMap);
if (isNotBlank(gaPath)) {
gaSet.add(gaPath);
}
}, 0, PathDB.FileType.file);
gaSet.forEach(ga -> {
gaMap.computeIfAbsent(ga, k -> new HashSet<>()).add(storeName);
});
logger.info("Scan result, store: {}, gaSet: {}", storeName, gaSet);
completed.add(storeName);
});
}
Aggregations