点赞、点踩失败回滚

This commit is contained in:
huangzhuanghua
2016-04-28 14:55:16 +08:00
parent 7863d4db81
commit 42171d95cd
146 changed files with 1198 additions and 1317 deletions

View File

@ -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;