Class CmsFolder

All Implemented Interfaces:
Serializable, Cloneable, Comparable<I_CmsResource>, I_CmsResource
Direct Known Subclasses:
CmsHistoryFolder

public class CmsFolder extends CmsResource
A folder resource in the OpenCms VFS.

A folder resource is a CmsResource object that can contain sub-resources.

Since:
6.0.0
See Also:
  • Constructor Details

    • CmsFolder

      public CmsFolder(CmsResource resource)
      Constructor, creates a new CmsFolder Object from the given CmsResource.

      Parameters:
      resource - the base resource object to create a folder from
    • CmsFolder

      public CmsFolder(CmsUUID structureId, CmsUUID resourceId, String path, int type, int flags, CmsUUID projectId, CmsResourceState state, long dateCreated, CmsUUID userCreated, long dateLastModified, CmsUUID userLastModified, long dateReleased, long dateExpired, int version)
      Constructor, creates a new CmsFolder object.

      Parameters:
      structureId - the id of this resources structure record
      resourceId - the id of this resources resource record
      path - the filename of this resouce
      type - the type of this resource
      flags - the flags of this resource
      projectId - the project id this resource was last modified in
      state - the state of this resource
      dateCreated - the creation date of this resource
      userCreated - the id of the user who created this resource
      dateLastModified - the date of the last modification of this resource
      userLastModified - the id of the user who did the last modification of this resource * @param size the size of the file content of this resource
      dateReleased - the release date of this resource
      dateExpired - the expiration date of this resource
      version - the version number of this resource
  • Method Details

    • isFolderSize

      public static final boolean isFolderSize(long size)
      Returns true if the given resource size describes a folder type.

      This is true in case size < 0.

      Parameters:
      size - the resource size to check
      Returns:
      true if the given resource size describes a folder type or false if it is no folder
    • isFolderType

      public static final boolean isFolderType(int typeId)
      Returns true if the given resource type id describes a folder type.

      Parameters:
      typeId - the resource type id to check
      Returns:
      true if the given resource type id describes a folder type or false if it is no folder or an unknown type.
    • isFolderType

      public static final boolean isFolderType(String typeName)
      Returns true if the given resource type name describes a folder type.

      Parameters:
      typeName - the resource type name to check
      Returns:
      true if the given resource type name describes a folder type
    • clone

      public Object clone()
      Returns a clone of this Objects instance.

      Overrides:
      clone in class CmsResource
      Returns:
      a clone of this instance
    • getDateContent

      public long getDateContent()
      A folder does always have the content date -1.

      Specified by:
      getDateContent in interface I_CmsResource
      Overrides:
      getDateContent in class CmsResource
      Returns:
      the date of the last modification of the content of this resource
      See Also:
    • getLength

      public int getLength()
      A folder does always have length -1.

      Specified by:
      getLength in interface I_CmsResource
      Overrides:
      getLength in class CmsResource
      Returns:
      the content length of the content
      See Also:
    • isFile

      public boolean isFile()
      Since this is a folder, not a file, false is always returned.

      Specified by:
      isFile in interface I_CmsResource
      Overrides:
      isFile in class CmsResource
      Returns:
      true if this resource is a file, false otherwise
      See Also:
    • isFolder

      public boolean isFolder()
      Since this is a folder, true is always returned.

      Specified by:
      isFolder in interface I_CmsResource
      Overrides:
      isFolder in class CmsResource
      Returns:
      true if this resource is a folder, false otherwise
      See Also:
    • isTemporaryFile

      public boolean isTemporaryFile()
      Description copied from class: CmsResource
      Returns true if this resource is a temporary file.

      A resource is considered a temporary file it is a file where the CmsResource.FLAG_TEMPFILE flag has been set, or if the file name (without parent folders) starts with the prefix char '~' (tilde).

      Overrides:
      isTemporaryFile in class CmsResource
      Returns:
      true if the given resource name is a temporary file
      See Also: