We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7de7f31 commit 61d1afeCopy full SHA for 61d1afe
library/src/com/lidroid/xutils/cache/LruDiskCache.java
@@ -424,7 +424,16 @@ public synchronized long getExpiryTimestamp(String key) throws IOException {
424
425
public File getCacheFile(String key, int index) {
426
String diskKey = fileNameGenerator.generate(key);
427
- return new File(this.directory, diskKey + "." + index);
+ File result = new File(this.directory, diskKey + "." + index);
428
+ if (result.exists()) {
429
+ return result;
430
+ } else {
431
+ try {
432
+ this.remove(key);
433
+ } catch (IOException ignore) {
434
+ }
435
+ return null;
436
437
}
438
439
public Snapshot get(String key) throws IOException {
0 commit comments