本文整理汇总了Java中cn.eoe.app.db.RequestCacheColumn类的典型用法代码示例。如果您正苦于以下问题:Java RequestCacheColumn类的具体用法?Java RequestCacheColumn怎么用?Java RequestCacheColumn使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RequestCacheColumn类属于cn.eoe.app.db包,在下文中一共展示了RequestCacheColumn类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getStringFromLocal
import cn.eoe.app.db.RequestCacheColumn; //导入依赖的package包/类
private static String getStringFromLocal(String requestPath,
String requestUrl, DBHelper dbHelper) {
String result = "";
Cursor cursor = getStringFromDB(requestUrl, dbHelper);
if (cursor.moveToFirst()) {
Long timestamp = cursor.getLong(cursor
.getColumnIndex(RequestCacheColumn.Timestamp));
String strContentType = cursor.getString(cursor
.getColumnIndex(RequestCacheColumn.Content_type));
long span = getSpanTimeFromConfigs(strContentType);
long nowTime = System.currentTimeMillis();
if ((nowTime - timestamp) > span * 60 * 1000) {
// 过期
deleteFileFromLocal(requestPath);
} else {
// 没过期
result = getFileFromLocal(requestPath);
}
}
return result;
}
示例2: getStringFromDB
import cn.eoe.app.db.RequestCacheColumn; //导入依赖的package包/类
/**
* 从db中查找数据
*
* @param requestUrl
* @param dbHelper
* @return
*/
private static Cursor getStringFromDB(String requestUrl, DBHelper dbHelper) {
String SQL = "select * from " + RequestCacheColumn.TABLE_NAME
+ " where " + RequestCacheColumn.URL + "='" + requestUrl + "'";
Cursor cursor = dbHelper.rawQuery(SQL, new String[] {});
return cursor;
}