public class FileStoreDataSet
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
protected static class |
FileStoreDataSet.LeafInfo |
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
cacheRootPath |
static java.lang.String |
DAY |
protected java.util.ArrayList<java.io.File> |
exclusionList |
protected boolean |
fileGranularity |
static java.lang.String |
HOUR |
protected java.util.ArrayList<FileStoreDataSet.LeafInfo> |
leafDirs |
static java.lang.String |
MONTH |
protected java.io.File |
root |
protected FileStoreDataSet.LeafInfo[] |
sortedLeafDirs |
static java.lang.String |
WEEK |
static java.lang.String |
YEAR |
Constructor and Description |
---|
FileStoreDataSet(java.io.File root,
java.lang.String cacheRootPath) |
Modifier and Type | Method and Description |
---|---|
protected static long |
computeDirectorySize(java.io.File dir) |
protected static long |
computeTimeOffset(java.lang.String unit,
int interval) |
void |
delete(boolean echo) |
protected void |
deleteFiles(java.io.File dir,
java.util.List<java.io.File> exclusions,
long timeBoundary,
boolean echo) |
void |
deleteOutOfScopeFiles(java.lang.String unit,
int interval,
boolean echo) |
protected static void |
findLeaves(java.io.File dir,
java.util.ArrayList<FileStoreDataSet.LeafInfo> leaves) |
static java.util.List<FileStoreDataSet> |
getDataSets(java.io.File cacheRoot)
Find all of the data set directories in a cache root.
|
java.util.List<java.io.File> |
getExclusions() |
long |
getLastModified() |
java.lang.String |
getName() |
long |
getOutOfScopeSize(java.lang.String unit,
int interval) |
java.lang.String |
getPath() |
long |
getSize() |
boolean |
isFileGranularity() |
protected static boolean |
isNumeric(java.lang.String s)
Determines if a string contains only digits.
|
protected static boolean |
isSingleDataSet(java.io.File[] subDirs)
Determines if a list of sub-directories should be treated as a single data set.
|
protected static java.io.File[] |
listDirs(java.io.File parent)
List all of the sub-directories in a parent directory.
|
void |
setExclusions(java.lang.Iterable<? extends java.io.File> exclusions) |
void |
setFileGranularity(boolean fileGranularity) |
protected void |
update() |
protected final java.lang.String cacheRootPath
public static final java.lang.String DAY
protected java.util.ArrayList<java.io.File> exclusionList
protected boolean fileGranularity
public static final java.lang.String HOUR
protected java.util.ArrayList<FileStoreDataSet.LeafInfo> leafDirs
public static final java.lang.String MONTH
protected final java.io.File root
protected FileStoreDataSet.LeafInfo[] sortedLeafDirs
public static final java.lang.String WEEK
public static final java.lang.String YEAR
public FileStoreDataSet(java.io.File root, java.lang.String cacheRootPath)
protected static long computeDirectorySize(java.io.File dir)
protected static long computeTimeOffset(java.lang.String unit, int interval)
public void delete(boolean echo)
protected void deleteFiles(java.io.File dir, java.util.List<java.io.File> exclusions, long timeBoundary, boolean echo)
public void deleteOutOfScopeFiles(java.lang.String unit, int interval, boolean echo)
protected static void findLeaves(java.io.File dir, java.util.ArrayList<FileStoreDataSet.LeafInfo> leaves)
public static java.util.List<FileStoreDataSet> getDataSets(java.io.File cacheRoot)
cacheRoot
- Cache root to search.public java.util.List<java.io.File> getExclusions()
public long getLastModified()
public java.lang.String getName()
public long getOutOfScopeSize(java.lang.String unit, int interval)
public java.lang.String getPath()
public long getSize()
public boolean isFileGranularity()
protected static boolean isNumeric(java.lang.String s)
s
- String to test.true
if s
contains only digits.protected static boolean isSingleDataSet(java.io.File[] subDirs)
true
if all of the sub-directories have numeric names. In this case, the numeric directories are most
likely used by the cache implementation to group files in a single data set. The numeric directory names do not
provide meaningful grouping to the user.subDirs
- List of sub-directories to test.true
if the directories should be treated as a single data set.protected static java.io.File[] listDirs(java.io.File parent)
parent
- Parent directory to search.parent
.public void setExclusions(java.lang.Iterable<? extends java.io.File> exclusions)
public void setFileGranularity(boolean fileGranularity)
protected void update()