|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--com.opencms.file.CmsResource
Describes a resource in the Cms. This resource can be a A_CmsFile or a A_CmsFolder.
| Field Summary | |
protected int |
m_size
The size of the file content. |
| Constructor Summary | |
CmsResource(int resourceId,
int parentId,
int fileId,
String resourceName,
int resourceType,
int resourceFlags,
int user,
int group,
int projectId,
int accessFlags,
int state,
int lockedBy,
int launcherType,
String launcherClassname,
long dateCreated,
long dateLastModified,
int resourceLastModifiedBy,
int size,
int lockedInProject)
Constructor, creates a new CmsRecource object. |
|
| Method Summary | |
Object |
clone()
Clones the CmsResource by creating a new CmsObject. |
boolean |
equals(Object obj)
Compares the overgiven object with this object. |
String |
getAbsolutePath()
Returns the absolute path of this resource, e.g. |
static String |
getAbsolutePath(String resourceName)
Returns the absolute path of the provided resource, e.g. |
int |
getAccessFlags()
Returns the accessflags of this resource. |
long |
getDateCreated()
Returns the date of the creation for this resource. |
long |
getDateLastModified()
Returns the date of the last modification for this resource. |
int |
getFileId()
Gets the File id for this resource. |
int |
getFlags()
Returns the flags of this resource ( not used yet; the Accessflags are served in getAccessFlags). |
String |
getFlagString()
Creates a Unix-Style string of access rights from the access right flag of a CmsResource |
int |
getGroupId()
Returns the groupid of this resource. |
String |
getLauncherClassname()
Gets the launcher classname for this resource. |
int |
getLauncherType()
Gets the launcher type id for this resource. |
int |
getLength()
Gets the length of the content (filesize). |
int |
getLockedInProject()
Gets the project id of the project that has locked this resource. |
String |
getName()
Returns the name of this resource. |
int |
getOwnerId()
Returns the userid of the resource owner. |
String |
getParent()
Returns the absolute parent folder name of this resource. |
static String |
getParent(String resource)
Returns the absolute parent folder name of a resource. |
int |
getParentId()
Gets the Parent database id for this resource. |
String |
getPath()
Returns the folder path of this resource, if the resource is a folder, the complete path of the folder is returned (not the parent folder path). |
static String |
getPath(String resource)
Returns the folder path of the resource with the given name, if the resource is a folder (i.e. ends with a "/"), the complete path of the folder is returned (not the parent folder path). |
static int |
getPathLevel(String resource)
Returns the directory level of a resource. |
static String |
getPathPart(String resource,
int level)
Returns the name of a parent folder of the given resource, that is either minus levels up from the current folder, or that is plus levels down from the root folder. |
int |
getProjectId()
Returns the project id for this resource. |
int |
getResourceId()
Gets the database id for this resource. |
int |
getResourceLastModifiedBy()
Gets the userId from the user who made the last change. |
String |
getResourceName()
Returns the resource name of this resource, e.g. |
String |
getRootName()
Returns the root name of this resource, e.g. |
int |
getState()
Returns the state of this resource. |
int |
getType()
Gets the type id for this resource. |
boolean |
inProject(CmsProject project)
Checks if a resource belongs to a project. |
boolean |
isFile()
Determines, if this resource is a file. |
boolean |
isFolder()
Determines, if this resource is a folder. |
boolean |
isLocked()
Determines, if this resource is locked by a user. |
int |
isLockedBy()
Returns the user idthat locked this resource. |
boolean |
isTouched()
Returns the isTouched. |
void |
setAccessFlags(int flags)
Sets the accessflags of this resource. |
void |
setDateLastModified(long time)
Sets the date of the last modification for this resource. |
void |
setFileId(int fileId)
Sets the File id for this resource. |
void |
setGroupId(int group)
Sets the groupId of this resource. |
void |
setLauncherType(int type)
Sets launcher the type id for this resource. |
void |
setLocked(int id)
Sets the the user id that locked this resource. |
void |
setLockedInProject(int project)
Sets the projectId in which this resource is locked. |
void |
setParentId(int parentId)
Sets the parent database id for this resource. |
void |
setProjectId(int project)
Sets the projectId of this resource. |
void |
setState(int state)
Sets the state of this resource. |
void |
setType(int type)
Sets the type id for this resource. |
void |
setUserId(int user)
Sets the userId of this resource. |
String |
toString()
Returns a string-representation for this object. |
| Methods inherited from class java.lang.Object |
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected int m_size
| Constructor Detail |
public CmsResource(int resourceId,
int parentId,
int fileId,
String resourceName,
int resourceType,
int resourceFlags,
int user,
int group,
int projectId,
int accessFlags,
int state,
int lockedBy,
int launcherType,
String launcherClassname,
long dateCreated,
long dateLastModified,
int resourceLastModifiedBy,
int size,
int lockedInProject)
resourceId - The database Id.parentId - The database Id of the parent folder.fileId - The id of the content.resourceName - The name (including complete path) of the resouce.resourceType - The type of this resource.projectId - The project id this resource belongs to.accessFlags - The access flags of this resource.state - The state of this resource.lockedBy - The user id of the user who has locked this resource.launcherType - The launcher that is require to process this recource.launcherClassname - The name of the Java class invoked by the launcher.dateCreated - The creation date of this resource.dateLastModified - The date of the last modification of the resource.resourceLastModifiedBy - The user who changed the file.| Method Detail |
public Object clone()
clone in class Objectpublic boolean equals(Object obj)
equals in class Objectpublic String getAbsolutePath()
/system/workplace/action/index.html
public static String getAbsolutePath(String resourceName)
/system/workplace/action/index.html
public String getRootName()
/default/vfs
public String getResourceName()
/default/vfs/system/workplace/action/index.html
public int getAccessFlags()
public long getDateCreated()
public long getDateLastModified()
public void setDateLastModified(long time)
public int getFileId()
public int getFlags()
public String getFlagString()
public int getGroupId()
public String getLauncherClassname()
public int getLauncherType()
public int getLength()
public String getName()
public int getOwnerId()
public String getParent()
The parent resource of a file is the folder of the file.
The parent resource of a folder is the parent folder.
The parent resource of the root folder is null.
Example: /system/workplace/ has the parent /system/.
null for the root folderpublic static String getParent(String resource)
The parent resource of a file is the folder of the file.
The parent resource of a folder is the parent folder.
The parent resource of the root folder is null.
Example: /system/workplace/ has the parent /system/.
resource - the resource to find the parent folder for
null for the root folderpublic String getPath()
Example: Returns /system/def/ for the
resource /system/def/file.html and
/system/def/ for the (folder) resource /system/def/.
Does not append the repository information to the result,
i.e. /system/def/ will be returned, not /default/vfs/system/def/.
public static String getPath(String resource)
This is achived by just cutting of everthing behind the last occurence of a "/" character
in the String, no check if performed if the resource exists or not in the VFS,
only resources that end with a "/" are considered to be folders.
Example: Returns /system/def/ for the
resource /system/def/file.html and
/system/def/ for the (folder) resource /system/def/..
resource - the name of a resource
public static String getPathPart(String resource,
int level)
resource - the name of a resource
public static int getPathLevel(String resource)
The root folder "/" has level 0, a folder "/foo/" would have level 1, a folfer "/foo/bar/" level 2 etc.
public int getParentId()
public int getProjectId()
public int getResourceId()
public int getResourceLastModifiedBy()
public int getState()
public int getType()
public int getLockedInProject()
public boolean inProject(CmsProject project)
project - The project which the resources is checked about.
public boolean isFile()
public boolean isFolder()
public boolean isLocked()
public int isLockedBy()
public void setAccessFlags(int flags)
public void setFileId(int fileId)
public void setGroupId(int group)
public void setLauncherType(int type)
public void setLocked(int id)
public void setParentId(int parentId)
public void setState(int state)
public void setType(int type)
public void setUserId(int user)
public void setProjectId(int project)
public void setLockedInProject(int project)
public String toString()
toString in class Objectpublic boolean isTouched()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||