Class CmsVfsUtil

java.lang.Object
org.opencms.util.CmsVfsUtil

public final class CmsVfsUtil extends Object
Provides Vfs utility functions.

Since:
11.0.0
  • Method Details

    • createFolder

      public static void createFolder(CmsObject cms, String rootPath) throws CmsException
      Creates a folder and its parent folders if they don't exist.

      Parameters:
      cms - the CMS context to use
      rootPath - the folder root path
      Throws:
      CmsException - if something goes wrong
    • isDefaultFile

      public static boolean isDefaultFile(CmsObject cms, CmsResource resource)
      Checks if the provided resource is a default file.
      Parameters:
      cms - the context
      resource - 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 context
      resource - the resource to read the property from
      propertyName - the name of the property to read
      locale - 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.