org.opencms.file.wrapper
Class CmsWrappedResource

java.lang.Object
  extended by org.opencms.file.wrapper.CmsWrappedResource

public class CmsWrappedResource
extends java.lang.Object

Helper class to create "virtual" resources not existing in the vfs which are based on existing resources.

It is not possible to change a CmsResource instance. This helper class clones a CmsResource and can change some attributes of the CmsResource like the path, the typeId or the length.

Since:
6.2.4
Version:
$Revision: 1.12 $
Author:
Peter Bonrad

Constructor Summary
CmsWrappedResource(CmsResource res)
          Creates a new virtual resource.
 
Method Summary
 CmsFile getFile()
          Returns the virtual resource as a file.
 int getLength()
          Returns the length.
 CmsResource getResource()
          Returns the virtual resource.
 java.lang.String getRootPath()
          Returns the rootPath.
 int getTypeId()
          Returns the typeId.
 boolean isFolder()
          Returns the isFolder.
 void setFolder(boolean isFolder)
          Sets the isFolder.
 void setLength(int length)
          Sets the length.
 void setRootPath(java.lang.String rootPath)
          Sets the rootPath.
 void setTypeId(int typeId)
          Sets the typeId.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CmsWrappedResource

public CmsWrappedResource(CmsResource res)
Creates a new virtual resource.

Parameters:
res - the resource this virtual resource is based on
Method Detail

getFile

public CmsFile getFile()
Returns the virtual resource as a file.

Returns:
the virtual resource as a file

getLength

public int getLength()
Returns the length.

Returns:
the length

getResource

public CmsResource getResource()
Returns the virtual resource.

Returns:
the virtual resource

getRootPath

public java.lang.String getRootPath()
Returns the rootPath.

Returns:
the rootPath

getTypeId

public int getTypeId()
Returns the typeId.

Returns:
the typeId

isFolder

public boolean isFolder()
Returns the isFolder.

Returns:
the isFolder

setFolder

public void setFolder(boolean isFolder)
Sets the isFolder.

Parameters:
isFolder - the isFolder to set

setLength

public void setLength(int length)
Sets the length.

Parameters:
length - the length to set

setRootPath

public void setRootPath(java.lang.String rootPath)
Sets the rootPath.

Parameters:
rootPath - the rootPath to set

setTypeId

public void setTypeId(int typeId)
Sets the typeId.

Parameters:
typeId - the typeId to set