Class CmsFolderSizeTable

java.lang.Object
org.opencms.file.quota.CmsFolderSizeTable

public class CmsFolderSizeTable extends Object
Object for storing folder size information for all folders in the VFS, and for efficiently updating and retrieving it.

Mutable, not threadsafe by itself.

  • Constructor Details

  • Method Details

    • getFolderReport

      Prepares a folder report consisting of subtree sizes for a bunch of folders.

      This is more efficient than querying for folder sizes individually.

      Parameters:
      folders - the folders
      Returns:
      the folder report
    • getTotalFolderSize

      public long getTotalFolderSize(String rootPath)
      Gets the total folder size for the complete subtree at the given root path.
      Parameters:
      rootPath - the root path for which to compute the size
      Returns:
      the total size
    • getTotalFolderSizeExclusive

      public long getTotalFolderSizeExclusive(String rootPath, Collection<String> otherPaths)
      Gets the folder size for the subtree at the given root path, but without including any folder sizes of subtrees at any paths from 'otherPaths' of which rootPath is a proper prefix.
      Parameters:
      rootPath - the root path for which to calculate the size
      otherPaths - the other paths to exclude from the size
      Returns:
      the total size
    • loadAll

      public void loadAll() throws CmsException
      Loads all folder size data.
      Throws:
      CmsException - if something goes wrong
    • updateSingle

      public void updateSingle(String rootPath) throws CmsException
      Updates the folder size for a single folder, not including subfolders.
      Parameters:
      rootPath - the root path of the folder for which to update the information
      Throws:
      CmsException - if something goes wrong
    • updateSubtreeCache

      public void updateSubtreeCache()
      Updates the subtree cache.
    • updateTree

      public void updateTree(String rootPath) throws CmsException
      Updates the information for a complete subtree.
      Parameters:
      rootPath - the root path for which to update the information
      Throws:
      CmsException - if something goes wrong