(DiskCacheEntity entity)
| 123 | } |
| 124 | |
| 125 | public void put(DiskCacheEntity entity) { |
| 126 | if (!available |
| 127 | || entity == null |
| 128 | || TextUtils.isEmpty(entity.getTextContent()) |
| 129 | || entity.getExpires() < System.currentTimeMillis()) { |
| 130 | return; |
| 131 | } |
| 132 | |
| 133 | try { |
| 134 | cacheDb.replace(entity); |
| 135 | } catch (Throwable ex) { |
| 136 | LogUtil.e(ex.getMessage(), ex); |
| 137 | } |
| 138 | |
| 139 | trimSize(); |
| 140 | } |
| 141 | |
| 142 | public DiskCacheFile getDiskCacheFile(String key) throws InterruptedException { |
| 143 | if (!available || TextUtils.isEmpty(key)) { |
no test coverage detected