Package org.opencms.file.wrapper
Class CmsWrappedResource
java.lang.Object
org.opencms.file.wrapper.CmsWrappedResource
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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetFile()
Returns the virtual resource as a file.int
Returns the length.Returns the virtual resource.Returns the rootPath.int
Returns the typeId.boolean
isFolder()
Returns the isFolder.void
setFolder
(boolean isFolder) Sets the isFolder.void
setLength
(int length) Sets the length.void
setRootPath
(String rootPath) Sets the rootPath.void
setTypeId
(int typeId) Sets the typeId.
-
Constructor Details
-
CmsWrappedResource
Creates a new virtual resource.- Parameters:
res
- the resource this virtual resource is based on
-
-
Method Details
-
getFile
Returns the virtual resource as a file.- Returns:
- the virtual resource as a file
-
getLength
Returns the length.- Returns:
- the length
-
getResource
Returns the virtual resource.- Returns:
- the virtual resource
-
getRootPath
Returns the rootPath.- Returns:
- the rootPath
-
getTypeId
Returns the typeId.- Returns:
- the typeId
-
isFolder
Returns the isFolder.- Returns:
- the isFolder
-
setFolder
Sets the isFolder.- Parameters:
isFolder
- the isFolder to set
-
setLength
Sets the length.- Parameters:
length
- the length to set
-
setRootPath
Sets the rootPath.- Parameters:
rootPath
- the rootPath to set
-
setTypeId
Sets the typeId.- Parameters:
typeId
- the typeId to set
-