Package org.opencms.file.wrapper
Class CmsResourceWrapperPreventCreateNameRegex
java.lang.Object
org.opencms.file.wrapper.A_CmsResourceWrapper
org.opencms.file.wrapper.CmsResourceWrapperPreventCreateNameRegex
- All Implemented Interfaces:
I_CmsResourceWrapper
Resource wrapper class which is used to prevent resources with names matching a given regex from being created.
-
Field Summary
Fields inherited from class org.opencms.file.wrapper.A_CmsResourceWrapper
m_isWrappedResource
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
If there is a configuration string for the wrapper, this method will be called with the configuration string before it is used.createResource
(CmsObject cms, String resourcepath, int type, byte[] content, 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, String source, 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
-
Constructor Details
-
CmsResourceWrapperPreventCreateNameRegex
-
-
Method Details
-
configure
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:
-
createResource
public CmsResource createResource(CmsObject cms, String resourcepath, int type, byte[] content, 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:
-
isWrappedResource
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:
-
moveResource
public boolean moveResource(CmsObject cms, String source, 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:
-