use of net.runelite.http.service.cache.beans.CacheEntry 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());
}
use of net.runelite.http.service.cache.beans.CacheEntry in project runelite by runelite.
the class CacheController method getArchiveData.
@RequestMapping("{cacheId}/{indexId}/{archiveId}/data")
public byte[] getArchiveData(@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 cacheService.getArchive(archiveEntry);
}
use of net.runelite.http.service.cache.beans.CacheEntry 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