forked from Qortal/qortal
Added convenience method to make the code more readable.
This commit is contained in:
parent
6375b9d14d
commit
11da1f72b1
@ -32,6 +32,10 @@ public class ArbitraryDataCache {
|
||||
this.service = service;
|
||||
}
|
||||
|
||||
public boolean isCachedDataAvailable() {
|
||||
return !this.shouldInvalidate();
|
||||
}
|
||||
|
||||
public boolean shouldInvalidate() {
|
||||
try {
|
||||
// If the user has requested an overwrite, always invalidate the cache
|
||||
|
@ -72,7 +72,7 @@ public class ArbitraryDataReader {
|
||||
// Not in the build queue - so check the cache itself
|
||||
ArbitraryDataCache cache = new ArbitraryDataCache(this.uncompressedPath, false,
|
||||
this.resourceId, this.resourceIdType, this.service);
|
||||
if (!cache.shouldInvalidate()) {
|
||||
if (cache.isCachedDataAvailable()) {
|
||||
this.filePath = this.uncompressedPath;
|
||||
return true;
|
||||
}
|
||||
@ -111,7 +111,8 @@ public class ArbitraryDataReader {
|
||||
try {
|
||||
ArbitraryDataCache cache = new ArbitraryDataCache(this.uncompressedPath, overwrite,
|
||||
this.resourceId, this.resourceIdType, this.service);
|
||||
if (!cache.shouldInvalidate()) {
|
||||
if (cache.isCachedDataAvailable()) {
|
||||
// Use cached data
|
||||
this.filePath = this.uncompressedPath;
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user