点赞、点踩失败回滚
This commit is contained in:
@ -16,6 +16,14 @@
|
||||
|
||||
package com.android.volley.toolbox;
|
||||
|
||||
import android.os.SystemClock;
|
||||
import android.util.Log;
|
||||
|
||||
import com.android.volley.Cache;
|
||||
import com.android.volley.VolleyLog;
|
||||
import com.gh.common.util.TimestampUtils;
|
||||
import com.gh.common.util.Utils;
|
||||
|
||||
import java.io.EOFException;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
@ -30,13 +38,6 @@ import java.util.Iterator;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import android.os.SystemClock;
|
||||
import android.util.Log;
|
||||
|
||||
import com.android.volley.Cache;
|
||||
import com.android.volley.VolleyLog;
|
||||
import com.gh.common.util.TimestampUtils;
|
||||
|
||||
/**
|
||||
* Cache implementation that caches files directly onto the hard disk in the
|
||||
* specified directory. The default disk usage size is 5MB, but is configurable.
|
||||
@ -115,9 +116,9 @@ public class DiskBasedCache implements Cache {
|
||||
// if the entry does not exist, return.
|
||||
if (entry == null) {
|
||||
if (key.contains("timestamp")) {
|
||||
key = TimestampUtils.removeTimestamp(key);
|
||||
entry = mEntries.get(key);
|
||||
if (entry == null) {
|
||||
Log.i("result", "get entrey is noll");
|
||||
entry = mEntries.get(TimestampUtils.removeTimestamp(key));
|
||||
if (entry == null){
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
@ -125,6 +126,10 @@ public class DiskBasedCache implements Cache {
|
||||
}
|
||||
}
|
||||
File file = getFileForKey(key);
|
||||
if (!file.exists() && key.contains("timestamp")) {
|
||||
Log.i("result", "file = " + file.getName() + " not exists");
|
||||
file = getFileForKey(TimestampUtils.removeTimestamp(key));
|
||||
}
|
||||
Log.i("result", "key = " + key);
|
||||
Log.i("result", "name = " + file.getName());
|
||||
CountingInputStream cis = null;
|
||||
|
||||
Reference in New Issue
Block a user