use of net.runelite.http.api.cache.Cache in project runelite by runelite.
the class CacheController method listArchives.
@RequestMapping("{cacheId}/{indexId}")
public List<CacheArchive> listArchives(@PathVariable int cacheId, @PathVariable int indexId) {
CacheEntry cache = cacheService.findCache(cacheId);
if (cache == null) {
throw new NotFoundException();
}
IndexEntry indexEntry = cacheService.findIndexForCache(cache, indexId);
if (indexEntry == null) {
throw new NotFoundException();
}
List<ArchiveEntry> archives = cacheService.findArchivesForIndex(indexEntry);
return archives.stream().map(archive -> new CacheArchive(archive.getArchiveId(), archive.getNameHash(), archive.getRevision())).collect(Collectors.toList());
}
use of net.runelite.http.api.cache.Cache in project runelite by runelite.
the class CacheController method listIndexes.
@RequestMapping("{cacheId}")
public List<CacheIndex> listIndexes(@PathVariable int cacheId) {
CacheEntry cache = cacheService.findCache(cacheId);
if (cache == null) {
throw new NotFoundException();
}
List<IndexEntry> indexes = cacheService.findIndexesForCache(cache);
return indexes.stream().map(entry -> new CacheIndex(entry.getIndexId(), entry.getRevision())).collect(Collectors.toList());
}
Aggregations