|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object tribble.io.DiskCacheFile
public class DiskCacheFile
Disk cached document file.
Notes
The contents of this document file information object are written to the cached directory control file, one line per document file. The format of the information is:
filename sep created sep access sep expiry sep sep sep sep docID nlWhich is composed of the following fields:
DiskCacheManager
Field Summary | |
---|---|
protected java.util.Date |
m_accessTime
Last access date for this document file. |
protected java.util.Date |
m_createTime
Creation date for this document file. |
protected java.lang.String |
m_docId
Document-ID of this document file. |
protected int |
m_expiryDays
Days past the last access date that this document file expires. |
protected java.io.File |
m_fname
Local cached filename for this document file. |
protected DiskCacheManager |
m_mgr
Local directory cache manager that owns (manages) this document file. |
(package private) static java.lang.String |
REV
Revision information. |
Constructor Summary | |
---|---|
protected |
DiskCacheFile(java.lang.String docId,
java.io.File fname,
DiskCacheManager mgr)
Constructor. |
Method Summary | |
---|---|
(package private) static DiskCacheFile |
fromEntryLine(java.lang.String line,
java.io.File dir)
Reconstruct a document file information object from a control file entry line. |
(package private) static java.util.Date |
fromIso8601(java.lang.String s)
Convert a text string containing a date in ISO-8601 format into a date. |
protected boolean |
hasExpired(java.util.Date now)
Determine if this document file has expired or not. |
protected java.lang.String |
toEntryLine()
Construct a control file entry line out of this cached document file information object. |
(package private) static java.lang.String |
toIso8601(java.util.Date when)
Convert a date into an ISO-8601 formatted text string. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
static final java.lang.String REV
protected DiskCacheManager m_mgr
protected java.lang.String m_docId
protected java.io.File m_fname
protected java.util.Date m_createTime
protected java.util.Date m_accessTime
protected int m_expiryDays
Constructor Detail |
---|
protected DiskCacheFile(java.lang.String docId, java.io.File fname, DiskCacheManager mgr)
docId
- The document-ID to associate with this cached document file.fname
- The name of the file residing in the local cache directory associated with
this cached document file.mgr
- The cache directory manager that owns (manages) this cached document file.DiskCacheManager.createFile(java.lang.String)
Method Detail |
---|
static DiskCacheFile fromEntryLine(java.lang.String line, java.io.File dir) throws java.io.IOException
line
- A cache index file entry line, containing information about a document
file.dir
- The cache directory name where the cached file resides.
java.io.IOException
- Thrown if line is malformed.toEntryLine()
static java.lang.String toIso8601(java.util.Date when)
when
- A date to convert.
fromIso8601(java.lang.String)
static java.util.Date fromIso8601(java.lang.String s)
s
- A text string in ISO-8601 format, "YYYYMMDDhhmmss". The time is
assumed to be relative to the UTC timezone.
toIso8601(java.util.Date)
protected boolean hasExpired(java.util.Date now)
now
- The current date.
DiskCacheManager.setExpiryDays(int)
,
DiskCacheManager.removeAllExpiredFiles()
,
DiskCacheManager.removeExpiredEntries()
protected java.lang.String toEntryLine()
fromEntryLine(java.lang.String, java.io.File)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |