public class FileCache extends ReservationService<java.io.File>
ReservationService.Reservation<T>| Constructor and Description |
|---|
FileCache(java.io.File cacheDir)
Creates a FileCache for the supplied directory.
|
| Modifier and Type | Method and Description |
|---|---|
ReservationService.Reservation<java.io.File> |
createReservation(java.io.File f)
Creates a reservation containing the supplied item.
|
void |
flushStaleCache(long staleness)
Expunges from the cache those files that were last accessed longer ago
than the supplied "staleness," expressed in milliseconds.
|
java.lang.String |
getCachePath() |
isReserved, reserve, tryReserve, tryWithReservation, unreserve, withReservationpublic FileCache(java.io.File cacheDir)
cacheDir - The directory to use for the cache.java.lang.IllegalArgumentException - If the supplied cacheDir is null, exists
but is not a readable directory, or can't be created.public void flushStaleCache(long staleness)
staleness - The maximum number of milliseconds ago a file
must have been accessed to avoid being deleted
from the cache.public java.lang.String getCachePath()
public ReservationService.Reservation<java.io.File> createReservation(java.io.File f)
ReservationServicecreateReservation in class ReservationService<java.io.File>f - The item being reserved.