gov.nasa.worldwindx.examples.util
Class FileStoreDataSet
java.lang.Object
gov.nasa.worldwindx.examples.util.FileStoreDataSet
public class FileStoreDataSet
- extends Object
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
cacheRootPath
protected final String cacheRootPath
DAY
public static final String DAY
- See Also:
- Constant Field Values
exclusionList
protected ArrayList<File> exclusionList
fileGranularity
protected boolean fileGranularity
HOUR
public static final String HOUR
- See Also:
- Constant Field Values
leafDirs
protected ArrayList<FileStoreDataSet.LeafInfo> leafDirs
MONTH
public static final String MONTH
- See Also:
- Constant Field Values
root
protected final File root
sortedLeafDirs
protected FileStoreDataSet.LeafInfo[] sortedLeafDirs
WEEK
public static final String WEEK
- See Also:
- Constant Field Values
YEAR
public static final String YEAR
- See Also:
- Constant Field Values
FileStoreDataSet
public FileStoreDataSet(File root,
String cacheRootPath)
computeDirectorySize
protected static long computeDirectorySize(File dir)
computeTimeOffset
protected static long computeTimeOffset(String unit,
int interval)
delete
public void delete(boolean echo)
deleteFiles
protected void deleteFiles(File dir,
List<File> exclusions,
long timeBoundary,
boolean echo)
deleteOutOfScopeFiles
public void deleteOutOfScopeFiles(String unit,
int interval,
boolean echo)
findLeaves
protected static void findLeaves(File dir,
ArrayList<FileStoreDataSet.LeafInfo> leaves)
getDataSets
public static List<FileStoreDataSet> getDataSets(File cacheRoot)
- Find all of the data set directories in a cache root.
- Parameters:
cacheRoot - Cache root to search.
- Returns:
- List of data sets in the specified cache.
getExclusions
public List<File> getExclusions()
getLastModified
public long getLastModified()
getName
public String getName()
getOutOfScopeSize
public long getOutOfScopeSize(String unit,
int interval)
getPath
public String getPath()
getSize
public long getSize()
isFileGranularity
public boolean isFileGranularity()
isNumeric
protected static boolean isNumeric(String s)
- Determines if a string contains only digits.
- Parameters:
s - String to test.
- Returns:
true if s contains only digits.
isSingleDataSet
protected static boolean isSingleDataSet(File[] subDirs)
- Determines if a list of sub-directories should be treated as a single data set. This implementation returns
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.
- Parameters:
subDirs - List of sub-directories to test.
- Returns:
true if the directories should be treated as a single data set.
listDirs
protected static File[] listDirs(File parent)
- List all of the sub-directories in a parent directory.
- Parameters:
parent - Parent directory to search.
- Returns:
- All sub-directories under
parent.
setExclusions
public void setExclusions(Iterable<? extends File> exclusions)
setFileGranularity
public void setFileGranularity(boolean fileGranularity)
update
protected void update()