public class CmsFile extends CmsResource
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.
STATE_CHANGED, STATE_DELETED, STATE_KEEP, STATE_NEW, STATE_UNCHANGED, TEMP_FILE_PREFIX
构造器和说明 |
---|
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.
|
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.
|
限定符和类型 | 方法和说明 |
---|---|
java.lang.Object |
clone()
Returns a clone of this Objects instance.
|
byte[] |
getContents()
Returns the content of this file.
|
int |
getLength() |
boolean |
isFile() |
boolean |
isFolder() |
boolean |
isTemporaryFile() |
void |
setContents(byte[] value)
Sets the contents of this file.
|
getFolderPath, getName, getParentFolder, getPathLevel, getPathPart, isFolder, isTemporaryFileName
public CmsFile(CmsResource resource)
resource
- the base resource object to create a file frompublic 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)
structureId
- the id of this resources structure recordresourceId
- the id of this resources resource recordpath
- the filename of this resourcetype
- the type of this resourceflags
- the flags of this resourceprojectId
- the project id this resource was last modified instate
- the state of this resourcedateCreated
- the creation date of this resourceuserCreated
- the id of the user who created this resourcedateLastModified
- the date of the last modification of this resourceuserLastModified
- the id of the user who did the last modification of this resourcedateReleased
- the release date of this resourcedateExpired
- the expiration date of this resourcelinkCount
- the count of all siblings of this resourcelength
- the size of the file content of this resourcedateContent
- the date of the last modification of the content of this resourceversion
- the version number of this resourcecontent
- the binary content data of this filepublic java.lang.Object clone()
clone
在类中 java.lang.Object
public byte[] getContents()
public int getLength()
org.opencms.file.CmsResource#getLength()
public boolean isFile()
org.opencms.file.CmsResource#isFile()
public boolean isFolder()
org.opencms.file.CmsResource#isFolder()
public boolean isTemporaryFile()
org.opencms.file.CmsResource#isTemporaryFile()
public void setContents(byte[] value)
This will also set the date content, but only if the content is already set.
value
- the content of this file