| Modifier and Type | Field and Description |
|---|---|
InternalCache |
internalCache |
| Constructor and Description |
|---|
Cache(File directory,
long maxSize)
在
directory中创建最多maxSize字节的缓存 |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
delete()
关闭缓存并删除其所有存储值。这将删除缓存目录中的所有文件,包括没有由缓存创建的文件
|
File |
directory() |
void |
evictAll()
删除缓存中存储的所有值。缓存中的写操作将正常完成,但不会存储相应的响应
|
void |
flush() |
int |
hitCount() |
void |
initialize()
始化缓存。这将包括从存储器中读取日志文件并构建必要的内存缓存信息
注意,如果应用程序选择不调用此方法来初始化缓存。默认情况下,将在第一次使用缓存时执行延迟初始化
|
boolean |
isClosed() |
static String |
key(UnoUrl url) |
long |
maxSize() |
int |
networkCount() |
int |
requestCount() |
long |
size() |
Iterator<String> |
urls()
在此缓存中的url上返回一个迭代器,该迭代器支持Iterator.remove()。
从迭代器中删除URL将从缓存中删除相应的响应。使用此来清除选定的响应
|
int |
writeAbortCount() |
int |
writeSuccessCount() |
public final InternalCache internalCache
public Cache(File directory, long maxSize)
directory中创建最多maxSize字节的缓存directory - 目录maxSize - 缓存的最大大小(以字节为单位)public void initialize()
throws IOException
IOException - 初始化异常public void delete()
throws IOException
IOException - 删除异常public void evictAll()
throws IOException
IOException - 清除异常public Iterator<String> urls() throws IOException
IOException - 异常public int writeAbortCount()
public int writeSuccessCount()
public long size()
throws IOException
IOExceptionpublic long maxSize()
public void flush()
throws IOException
flush in interface FlushableIOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic File directory()
public boolean isClosed()
public int networkCount()
public int hitCount()
public int requestCount()
Copyright © 2019. All rights reserved.