Package nl.bebr.mapviewer.data.cache.spi
Class CacheCleaner
- java.lang.Object
-
- nl.bebr.mapviewer.data.cache.spi.CacheCleaner
-
public class CacheCleaner extends Object
Class responsible for keeping file cache under specified size.- Author:
- Frantisek Post
-
-
Field Summary
Fields Modifier and Type Field Description static longDEFAULT_SIZEprotected longmaximumCacheSizestatic longUNLIMITED_SIZE
-
Constructor Summary
Constructors Modifier Constructor Description protectedCacheCleaner()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static CacheCleanergetInstance()Gets instanceprotected org.openide.filesystems.FileObjectgetRootDir()booleanisUnlimited()Returnstrueif size is unlimited, otherwise {voidrun()Starts the CacheCleanerprotected voidrunInternal()voidsetMaximumCacheSize(long maximumCacheSize)Set the maximum file cache size
-
-
-
Field Detail
-
DEFAULT_SIZE
public static final long DEFAULT_SIZE
- See Also:
- Constant Field Values
-
UNLIMITED_SIZE
public static final long UNLIMITED_SIZE
- See Also:
- Constant Field Values
-
maximumCacheSize
protected long maximumCacheSize
-
-
Method Detail
-
runInternal
protected void runInternal()
-
getRootDir
protected org.openide.filesystems.FileObject getRootDir()
-
run
public void run()
Starts the CacheCleaner
-
getInstance
public static CacheCleaner getInstance()
Gets instance- Returns:
- instance
-
setMaximumCacheSize
public void setMaximumCacheSize(long maximumCacheSize)
Set the maximum file cache size- Parameters:
maximumCacheSize- maximum file cache size
-
isUnlimited
public boolean isUnlimited()
Returnstrueif size is unlimited, otherwise {- Returns:
-
-