public class CacheEntry
extends java.lang.Object
| Constructor and Description |
|---|
CacheEntry(DiskCache diskCache,
java.lang.String key) |
| Modifier and Type | Method and Description |
|---|---|
void |
abortEdit() |
void |
commit()
Commits this edit so it is visible to readers.
|
boolean |
delete()
delete all content
|
java.io.File |
getCacheFile() |
java.io.InputStream |
getInputStream()
Returns an unbuffered input stream to read the last committed value,
or null if no value has been committed.
|
java.lang.String |
getKey() |
long |
getLastSize() |
long |
getSize() |
java.lang.String |
getString()
Returns the last committed value as a string, or null if no value
has been committed.
|
java.io.File |
getTempFile() |
boolean |
isReadable() |
boolean |
isUnderEdit() |
java.io.OutputStream |
newOutputStream()
Returns a new unbuffered output stream to write the value
If the underlying output stream encounters errors
when writing to the filesystem, this edit will be aborted when
commit() is called. |
void |
setSize(long size) |
CacheEntry |
setString(java.lang.String value)
Sets the value
|
public CacheEntry(DiskCache diskCache, java.lang.String key)
public boolean isUnderEdit()
public java.lang.String getKey()
public java.io.File getCacheFile()
public long getSize()
public void setSize(long size)
public long getLastSize()
public java.io.File getTempFile()
public boolean isReadable()
public java.io.InputStream getInputStream()
throws java.io.IOException
java.io.IOExceptionpublic java.lang.String getString()
throws java.io.IOException
java.io.IOExceptionpublic CacheEntry setString(java.lang.String value) throws java.io.IOException
java.io.IOExceptionpublic java.io.OutputStream newOutputStream()
throws java.io.IOException
commit() is called. The returned output stream does not throw
IOExceptions.java.io.IOExceptionpublic boolean delete()
throws java.io.IOException
java.io.IOExceptionpublic void commit()
throws java.io.IOException
java.io.IOExceptionpublic void abortEdit()
throws java.io.IOException
java.io.IOException