Interface I_CmsResource

All Known Subinterfaces:
I_CmsHistoryResource
All Known Implementing Classes:
CmsFile, CmsFolder, CmsHistoryFile, CmsHistoryFolder, CmsJspResourceWrapper, CmsResource, CmsSearchResource

public interface I_CmsResource
Common ancestor interface for CmsFile and CmsFolder as well as for CmsHistoryFile and CmsHistoryFolder.

Since:
8.0.0
  • Field Details

  • Method Details

    • getDateContent

      Returns the date of the last modification of the content of this resource.

      Returns:
      the date of the last modification of the content of this resource
    • getDateCreated

      Returns the date of the creation of this resource.

      Returns:
      the date of the creation of this resource
    • getDateExpired

      Returns the expiration date this resource.

      Returns:
      the expiration date of this resource
    • getDateLastModified

      Returns the date of the last modification of this resource.

      Returns:
      the date of the last modification of this resource
    • getDateReleased

      Returns the release date this resource.

      Returns:
      the release date of this resource
    • getFlags

      int getFlags()
      Returns the flags of this resource.

      Returns:
      the flags of this resource
    • getLength

      int getLength()
      Returns the content length of this resource.

      If the resource is a file, then this is the byte size of the file content. If the resource is a folder, then the size is always -1.

      Returns:
      the content length of this resource
    • getName

      Returns the file name of this resource without parent folders, for example index.html.

      Returns:
      the file name of this resource without parent folders
    • getProjectLastModified

      Returns the id of the CmsProject where this resource has been last modified.

      Returns:
      the id of the CmsProject where this resource has been last modified, or null
    • getResourceId

      Returns the id of the database content record of this resource.

      Returns:
      the id of the database content record of this resource
    • getRootPath

      Returns the name of this resource with it's full path from the top level root folder, for example /sites/default/myfolder/index.html.

      Returns:
      name of this resource with it's full path from the top level root folder
    • getSiblingCount

      Returns the number of siblings of this resource, also counting this resource.

      If a resource has no sibling, the total sibling count for this resource is 1, if a resource has n siblings, the sibling count is n + 1.

      Returns:
      the number of siblings of this resource, also counting this resource
    • getState

      Returns the state of this resource.

      Returns:
      the state of this resource
    • getStructureId

      Returns the id of the database structure record of this resource.

      Returns:
      the id of the database structure record of this resource
    • getTypeId

      int getTypeId()
      Returns the resource type id for this resource.

      Returns:
      the resource type id of this resource
    • getUserCreated

      Returns the id of the CmsUser who created this resource.

      Returns:
      the id of the CmsUser who created this resource
    • getUserLastModified

      Returns the id of the CmsUser who made the last modification on this resource.

      Returns:
      the id of the CmsUser who made the last modification on this resource

    • getVersion

      int getVersion()
      Returns the current version number of this resource.

      Returns:
      the current version number of this resource
    • isExpired

      boolean isExpired(long time)
      Returns true if this resource is expired at the given time according to the information stored in getDateExpired().

      Parameters:
      time - the time to check the expiration date against
      Returns:
      true if this resource is expired at the given time
      See Also:
    • isFile

      boolean isFile()
      Returns true if the resource is a file, i.e. can have no sub-resources.

      Returns:
      true if this resource is a file, false otherwise
    • isFolder

      boolean isFolder()
      Returns true if the resource is a folder, i.e. can have sub-resources.

      Returns:
      true if this resource is a folder, false otherwise
    • isInternal

      boolean isInternal()
      Checks if the resource is internal.

      This state is stored as bit 1 in the resource flags.

      Returns:
      true if the resource is internal, otherwise false
    • isLabeled

      boolean isLabeled()
      Checks if the link has to be labeled with a special icon in the explorer view.

      This state is stored as bit 2 in the resource flags.

      Returns:
      true if a link to the resource has to be labeled, otherwise false
    • isReleased

      boolean isReleased(long time)
      Returns true if this resource is released at the given time according to the information stored in getDateReleased().

      Parameters:
      time - the time to check the release date against
      Returns:
      true if this resource is released at the given time
      See Also:
    • isReleasedAndNotExpired

      boolean isReleasedAndNotExpired(long time)
      Returns true if this resource is valid at the given time according to the information stored in getDateReleased() and getDateExpired().

      A resource is valid if it is released and not yet expired.

      Parameters:
      time - the time to check the release and expiration date against
      Returns:
      true if this resource is valid at the given time
      See Also:
    • isTouched

      boolean isTouched()
      Returns true if this resource was touched.

      Returns:
      boolean true if this resource was touched