Class FileStoreDataSet


  • public class FileStoreDataSet
    extends java.lang.Object
    • Constructor Detail

      • FileStoreDataSet

        public FileStoreDataSet​(java.io.File root,
                                java.lang.String cacheRootPath)
    • Method Detail

      • update

        protected void update()
      • isFileGranularity

        public boolean isFileGranularity()
      • setFileGranularity

        public void setFileGranularity​(boolean fileGranularity)
      • getPath

        public java.lang.String getPath()
      • getName

        public java.lang.String getName()
      • getExclusions

        public java.util.List<java.io.File> getExclusions()
      • setExclusions

        public void setExclusions​(java.lang.Iterable<? extends java.io.File> exclusions)
      • getSize

        public long getSize()
      • getOutOfScopeSize

        public long getOutOfScopeSize​(java.lang.String unit,
                                      int interval)
      • getLastModified

        public long getLastModified()
      • deleteOutOfScopeFiles

        public void deleteOutOfScopeFiles​(java.lang.String unit,
                                          int interval,
                                          boolean echo)
      • deleteFiles

        protected void deleteFiles​(java.io.File dir,
                                   java.util.List<java.io.File> exclusions,
                                   long timeBoundary,
                                   boolean echo)
      • delete

        public void delete​(boolean echo)
      • computeTimeOffset

        protected static long computeTimeOffset​(java.lang.String unit,
                                                int interval)
      • findLeaves

        protected static void findLeaves​(java.io.File dir,
                                         java.util.ArrayList<FileStoreDataSet.LeafInfo> leaves)
      • computeDirectorySize

        protected static long computeDirectorySize​(java.io.File dir)
      • getDataSets

        public static java.util.List<FileStoreDataSet> getDataSets​(java.io.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.
      • listDirs

        protected static java.io.File[] listDirs​(java.io.File parent)
        List all of the sub-directories in a parent directory.
        Parameters:
        parent - Parent directory to search.
        Returns:
        All sub-directories under parent.
      • isSingleDataSet

        protected static boolean isSingleDataSet​(java.io.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.
      • isNumeric

        protected static boolean isNumeric​(java.lang.String s)
        Determines if a string contains only digits.
        Parameters:
        s - String to test.
        Returns:
        true if s contains only digits.