use of net.runelite.http.api.cache.CacheArchive 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.CacheArchive in project runelite by runelite.
the class CacheController method getCacheArchive.
@RequestMapping("{cacheId}/{indexId}/{archiveId}")
public CacheArchive getCacheArchive(@PathVariable int cacheId, @PathVariable int indexId, @PathVariable int archiveId) {
CacheEntry cache = cacheService.findCache(cacheId);
if (cache == null) {
throw new NotFoundException();
}
IndexEntry indexEntry = cacheService.findIndexForCache(cache, indexId);
if (indexEntry == null) {
throw new NotFoundException();
}
ArchiveEntry archiveEntry = cacheService.findArchiveForIndex(indexEntry, archiveId);
if (archiveEntry == null) {
throw new NotFoundException();
}
return new CacheArchive(archiveEntry.getArchiveId(), archiveEntry.getNameHash(), archiveEntry.getRevision());
}
Aggregations