Package org.opencms.ugc
Class CmsUgcSessionSecurityUtil
java.lang.Object
org.opencms.ugc.CmsUgcSessionSecurityUtil
Helper class which implements some of the security checks for user generated content creation.
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
checkCreateContent
(CmsObject cms, CmsUgcConfiguration config) Checks whether a new XML content may be created and throws an exception if this is not the case.static void
checkCreateUpload
(CmsObject cms, CmsUgcConfiguration config, String name, long size) Checks whether an uploaded file can be created in the VFS, and throws an exception otherwise.
-
Method Details
-
checkCreateContent
public static void checkCreateContent(CmsObject cms, CmsUgcConfiguration config) throws CmsUgcException Checks whether a new XML content may be created and throws an exception if this is not the case.- Parameters:
cms
- the current CMS contextconfig
- the form configuration- Throws:
CmsUgcException
- if something goes wrong
-
checkCreateUpload
public static void checkCreateUpload(CmsObject cms, CmsUgcConfiguration config, String name, long size) throws CmsUgcException Checks whether an uploaded file can be created in the VFS, and throws an exception otherwise.- Parameters:
cms
- the current CMS contextconfig
- the form configurationname
- the file name of the uploaded filesize
- the size of the uploaded file- Throws:
CmsUgcException
- if something goes wrong
-