Package org.opencms.file.quota
Class CmsFolderSizeTable
java.lang.Object
org.opencms.file.quota.CmsFolderSizeTable
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 Summary
ConstructorsConstructorDescriptionCmsFolderSizeTable
(CmsObject cms, boolean online) Create a new instance.Creates a deep copy of an existing instance. -
Method Summary
Modifier and TypeMethodDescriptiongetFolderReport
(Collection<String> folders) Prepares a folder report consisting of subtree sizes for a bunch of folders.long
getTotalFolderSize
(String rootPath) Gets the total folder size for the complete subtree at the given root path.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.void
loadAll()
Loads all folder size data.void
updateSingle
(String rootPath) Updates the folder size for a single folder, not including subfolders.void
Updates the subtree cache.void
updateTree
(String rootPath) Updates the information for a complete subtree.
-
Constructor Details
-
CmsFolderSizeTable
Creates a deep copy of an existing instance.- Parameters:
other
-
-
CmsFolderSizeTable
Create a new instance.- Parameters:
cms
- the CMS context
-
-
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
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
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 sizeotherPaths
- the other paths to exclude from the size- Returns:
- the total size
-
loadAll
Loads all folder size data.- Throws:
CmsException
- if something goes wrong
-
updateSingle
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
Updates the subtree cache. -
updateTree
Updates the information for a complete subtree.- Parameters:
rootPath
- the root path for which to update the information- Throws:
CmsException
- if something goes wrong
-