Class CmsFile

  • All Implemented Interfaces:, java.lang.Cloneable, java.lang.Comparable<I_CmsResource>, I_CmsResource
    Direct Known Subclasses:

    public class CmsFile
    extends CmsResource
    A file resource in the OpenCms VFS.

    A file resource is a CmsResource that contains an additional byte array of binary data, which is the file content.

    A file object is not allowed to have sub-resources.

    See Also:
    Serialized Form
    • Constructor Detail

      • CmsFile

        public CmsFile​(CmsResource resource)
        Constructor, creates a new file Object from the given resource with an empty byte array as file content, if the resource does not implement a file.

        resource - the base resource object to create a file from
      • CmsFile

        public CmsFile​(CmsUUID structureId,
                       CmsUUID resourceId,
                       java.lang.String path,
                       int type,
                       int flags,
                       CmsUUID projectId,
                       CmsResourceState state,
                       long dateCreated,
                       CmsUUID userCreated,
                       long dateLastModified,
                       CmsUUID userLastModified,
                       long dateReleased,
                       long dateExpired,
                       int linkCount,
                       int length,
                       long dateContent,
                       int version,
                       byte[] content)
        Constructor, creates a new file object.

        structureId - the id of this resources structure record
        resourceId - the id of this resources resource record
        path - the filename of this resource
        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
        dateReleased - the release date of this resource
        dateExpired - the expiration date of this resource
        linkCount - the count of all siblings of this resource
        length - the size of the file content of this resource
        dateContent - the date of the last modification of the content of this resource
        version - the version number of this resource
        content - the binary content data of this file