Package org.opencms.file
Class CmsFolder
- java.lang.Object
-
- org.opencms.file.CmsResource
-
- org.opencms.file.CmsFolder
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,java.lang.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:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.opencms.file.CmsResource
CmsResource.CmsResourceCopyMode, CmsResource.CmsResourceDeleteMode, CmsResource.CmsResourceUndoMode
-
Nested classes/interfaces inherited from interface org.opencms.file.I_CmsResource
I_CmsResource.CmsResourceAttribute
-
-
Field Summary
-
Fields inherited from class org.opencms.file.CmsResource
COPY_AS_NEW, COPY_AS_SIBLING, COPY_PRESERVE_SIBLING, DATE_EXPIRED_DEFAULT, DATE_RELEASED_DEFAULT, DATE_RELEASED_EXPIRED_IGNORE, DELETE_PRESERVE_SIBLINGS, DELETE_REMOVE_SIBLINGS, FLAG_INTERNAL, FLAG_LABELED, FLAG_TEMPFILE, m_dateContent, m_length, NAME_CONSTRAINTS, STATE_CHANGED, STATE_DELETED, STATE_KEEP, STATE_NEW, STATE_UNCHANGED, TEMP_FILE_PREFIX, TOUCH_DATE_UNCHANGED, UNDO_CONTENT, UNDO_CONTENT_RECURSIVE, UNDO_MOVE_CONTENT, UNDO_MOVE_CONTENT_RECURSIVE, VFS_FOLDER_SITES, VFS_FOLDER_SYSTEM
-
Fields inherited from interface org.opencms.file.I_CmsResource
COMPARE_DATE_LAST_MODIFIED, COMPARE_DATE_RELEASED, COMPARE_ROOT_PATH, COMPARE_ROOT_PATH_IGNORE_CASE, COMPARE_ROOT_PATH_IGNORE_CASE_FOLDERS_FIRST
-
-
Constructor Summary
Constructors Constructor Description CmsFolder(CmsResource resource)Constructor, creates a new CmsFolder Object from the given CmsResource.CmsFolder(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 version)Constructor, creates a new CmsFolder object.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectclone()Returns a clone of this Objects instance.longgetDateContent()A folder does always have the content date-1.intgetLength()A folder does always have length-1.booleanisFile()Since this is a folder, not a file,falseis always returned.booleanisFolder()Since this is a folder,trueis always returned.static booleanisFolderSize(long size)Returnstrueif the given resource size describes a folder type.static booleanisFolderType(int typeId)Returnstrueif the given resource type id describes a folder type.static booleanisFolderType(java.lang.String typeName)Returnstrueif the given resource type name describes a folder type.booleanisTemporaryFile()Returnstrueif this resource is a temporary file.-
Methods inherited from class org.opencms.file.CmsResource
checkResourceName, compareTo, equals, getCopy, getDateCreated, getDateExpired, getDateLastModified, getDateReleased, getExtension, getFlags, getFolderPath, getName, getName, getParentFolder, getPathLevel, getPathPart, getProjectLastModified, getResourceId, getRootPath, getSiblingCount, getState, getStructureId, getTypeId, getUserCreated, getUserLastModified, getVersion, hashCode, isExpired, isFolder, isInternal, isInternalOrInInternalFolder, isLabeled, isReleased, isReleasedAndNotExpired, isTemporaryFileName, isTouched, setDateExpired, setDateLastModified, setDateReleased, setFlags, setInternal, setState, setType, setUserLastModified, toString
-
-
-
-
Constructor Detail
-
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, 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 version)
Constructor, creates a new CmsFolder object.- Parameters:
structureId- the id of this resources structure recordresourceId- the id of this resources resource recordpath- the filename of this resoucetype- 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 resource * @param size the size of the file content of this resourcedateReleased- the release date of this resourcedateExpired- the expiration date of this resourceversion- the version number of this resource
-
-
Method Detail
-
isFolderSize
public static final boolean isFolderSize(long size)
Returnstrueif the given resource size describes a folder type.This is
truein casesize < 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)
Returnstrueif 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(java.lang.String typeName)
Returnstrueif 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 java.lang.Object clone()
Returns a clone of this Objects instance.- Overrides:
clonein classCmsResource- Returns:
- a clone of this instance
-
getDateContent
public long getDateContent()
A folder does always have the content date-1.- Specified by:
getDateContentin interfaceI_CmsResource- Overrides:
getDateContentin classCmsResource- Returns:
- the date of the last modification of the content of this resource
- See Also:
CmsResource.getDateContent()
-
getLength
public int getLength()
A folder does always have length-1.- Specified by:
getLengthin interfaceI_CmsResource- Overrides:
getLengthin classCmsResource- Returns:
- the content length of the content
- See Also:
CmsResource.getLength()
-
isFile
public boolean isFile()
Since this is a folder, not a file,falseis always returned.- Specified by:
isFilein interfaceI_CmsResource- Overrides:
isFilein classCmsResource- Returns:
- true if this resource is a file, false otherwise
- See Also:
CmsResource.isFile()
-
isFolder
public boolean isFolder()
Since this is a folder,trueis always returned.- Specified by:
isFolderin interfaceI_CmsResource- Overrides:
isFolderin classCmsResource- Returns:
- true if this resource is a folder, false otherwise
- See Also:
CmsResource.isFolder()
-
isTemporaryFile
public boolean isTemporaryFile()
Description copied from class:CmsResourceReturnstrueif this resource is a temporary file.A resource is considered a temporary file it is a file where the
CmsResource.FLAG_TEMPFILEflag has been set, or if the file name (without parent folders) starts with the prefix char'~'(tilde).- Overrides:
isTemporaryFilein classCmsResource- Returns:
trueif the given resource name is a temporary file- See Also:
CmsResource.isTemporaryFile()
-
-