Package org.opencms.file.wrapper
Class CmsResourceWrapperPreventCreateNameCI
- java.lang.Object
-
- org.opencms.file.wrapper.A_CmsResourceWrapper
-
- org.opencms.file.wrapper.CmsResourceWrapperPreventCreateNameCI
-
- All Implemented Interfaces:
I_CmsResourceWrapper
public class CmsResourceWrapperPreventCreateNameCI extends A_CmsResourceWrapper
Resource wrapper class which is used to prevent resources with a certain name from being created.This can be used to prevent file browsers accessing the repository from creating thumbnail files. This class does not distinguish between upper case and lower case letters in file names.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
NAME_SEPARATOR
File name separator.-
Fields inherited from class org.opencms.file.wrapper.A_CmsResourceWrapper
m_isWrappedResource
-
-
Constructor Summary
Constructors Constructor Description CmsResourceWrapperPreventCreateNameCI()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
configure(java.lang.String configString)
If there is a configuration string for the wrapper, this method will be called with the configuration string before it is used.CmsResource
createResource(CmsObject cms, java.lang.String resourcepath, int type, byte[] content, java.util.List<CmsProperty> properties)
Creates a new resource of the given resource type with the provided content and properties.boolean
isWrappedResource(CmsObject cms, CmsResource res)
Is called to check if the given resource is handled by this wrapper.boolean
moveResource(CmsObject cms, java.lang.String source, java.lang.String destination)
Moves a resource to the given destination.-
Methods inherited from class org.opencms.file.wrapper.A_CmsResourceWrapper
addResourcesToFolder, copyResource, deleteResource, getLock, lockResource, readFile, readResource, restoreLink, rewriteLink, unlockResource, wrapResource, writeFile
-
-
-
-
Field Detail
-
NAME_SEPARATOR
public static final java.lang.String NAME_SEPARATOR
File name separator.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CmsResourceWrapperPreventCreateNameCI
public CmsResourceWrapperPreventCreateNameCI()
-
-
Method Detail
-
configure
public void configure(java.lang.String configString)
Description copied from interface:I_CmsResourceWrapper
If there is a configuration string for the wrapper, this method will be called with the configuration string before it is used.Otherwise, it will not be called.
- Specified by:
configure
in interfaceI_CmsResourceWrapper
- Overrides:
configure
in classA_CmsResourceWrapper
- Parameters:
configString
- the configuration string for the wrapper- See Also:
A_CmsResourceWrapper.configure(java.lang.String)
-
createResource
public CmsResource createResource(CmsObject cms, java.lang.String resourcepath, int type, byte[] content, java.util.List<CmsProperty> properties) throws CmsIllegalArgumentException
Description copied from interface:I_CmsResourceWrapper
Creates a new resource of the given resource type with the provided content and properties.First should be a check if the resourcename is handled by this resource wrapper.
It is possible that the path in the resourcename is a virtual path and so has to be translated into a valid path existing in the VFS to create the resource.
- Specified by:
createResource
in interfaceI_CmsResourceWrapper
- Overrides:
createResource
in classA_CmsResourceWrapper
- Parameters:
cms
- the initialized CmsObjectresourcepath
- the name of the resource to create (full path)type
- the type of the resource to createcontent
- the content for the new resourceproperties
- the properties for the new resource- Returns:
- the created resource or null if not handled by this resource wrapper
- Throws:
CmsIllegalArgumentException
- if thesource
argument is null or of length 0- See Also:
A_CmsResourceWrapper.createResource(org.opencms.file.CmsObject, java.lang.String, int, byte[], java.util.List)
-
isWrappedResource
public boolean isWrappedResource(CmsObject cms, CmsResource res)
Description copied from interface:I_CmsResourceWrapper
Is called to check if the given resource is handled by this wrapper.- Parameters:
cms
- the initialized CmsObjectres
- the resource to check- Returns:
- true if the resource will be handled by the wrapper otherwise false
- See Also:
I_CmsResourceWrapper.isWrappedResource(org.opencms.file.CmsObject, org.opencms.file.CmsResource)
-
moveResource
public boolean moveResource(CmsObject cms, java.lang.String source, java.lang.String destination) throws CmsException, CmsIllegalArgumentException
Description copied from interface:I_CmsResourceWrapper
Moves a resource to the given destination.First should be a check if the source and/or the destination are handled by this resource wrapper.
It is possible that the path in the source or in the destination are virtual paths and so has to be translated into valid paths existing in the VFS to move the resource.
- Specified by:
moveResource
in interfaceI_CmsResourceWrapper
- Overrides:
moveResource
in classA_CmsResourceWrapper
- Parameters:
cms
- the current cms contextsource
- the name of the resource to movedestination
- the destination resource name- Returns:
- true if the move action was handled by this resource wrapper otherwise false
- Throws:
CmsException
- if something goes wrongCmsIllegalArgumentException
- if thesource
argument is null or of length 0- See Also:
A_CmsResourceWrapper.moveResource(org.opencms.file.CmsObject, java.lang.String, java.lang.String)
-
-