Package org.opencms.util
Class CmsVfsUtil
java.lang.Object
org.opencms.util.CmsVfsUtil
Provides Vfs utility functions.
- Since:
- 11.0.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
createFolder
(CmsObject cms, String rootPath) Creates a folder and its parent folders if they don't exist.static boolean
isDefaultFile
(CmsObject cms, CmsResource resource) Checks if the provided resource is a default file.static String
readPropertyValueWithFolderFallbackForDefaultFiles
(CmsObject cms, CmsResource resource, String propertyName, Locale locale) Reads the property value for the provided name and resource.
-
Method Details
-
createFolder
Creates a folder and its parent folders if they don't exist.- Parameters:
cms
- the CMS context to userootPath
- the folder root path- Throws:
CmsException
- if something goes wrong
-
isDefaultFile
Checks if the provided resource is a default file.- Parameters:
cms
- the contextresource
- the resource to check- Returns:
- true, if the file is an default file. False if the file is no default file or an exception occurred.
-
readPropertyValueWithFolderFallbackForDefaultFiles
public static String readPropertyValueWithFolderFallbackForDefaultFiles(CmsObject cms, CmsResource resource, String propertyName, Locale locale) Reads the property value for the provided name and resource. The locale specific properties are read first, with fallback to the default property. In case the resource is a default file and the property is not found on the file itself, the property is read (again locale specific) on the folder as fallback.- Parameters:
cms
- the contextresource
- the resource to read the property frompropertyName
- the name of the property to readlocale
- the locale to read the property in.- Returns:
- the property value or null, if the property is not set at all or a exception occurred.
-