Package org.xwiki.attachment.validation
Class AttachmentValidationScriptService
- java.lang.Object
-
- org.xwiki.attachment.validation.AttachmentValidationScriptService
-
- All Implemented Interfaces:
org.xwiki.script.service.ScriptService
@Component @Singleton @Named("attachmentValidation") @Unstable public class AttachmentValidationScriptService extends Object implements org.xwiki.script.service.ScriptService
Script service for the attachment validation. Provide the attachment validation configuration values.- Since:
- 14.10
- Version:
- $Id: 5f27732b62e766616e36f607c355bddb5f4ff842 $
-
-
Constructor Summary
Constructors Constructor Description AttachmentValidationScriptService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<String>
getAllowedMimetypes()
List<String>
getAllowedMimetypes(org.xwiki.model.reference.DocumentReference documentReference)
List<String>
getBlockerMimetypes()
List<String>
getBlockerMimetypes(org.xwiki.model.reference.DocumentReference documentReference)
long
getUploadMaxSize()
long
getUploadMaxSize(org.xwiki.model.reference.EntityReference entityReference)
-
-
-
Method Detail
-
getAllowedMimetypes
public List<String> getAllowedMimetypes()
- Returns:
- the list of allowed attachment mimetypes of the current document. A joker (@code '*') can be used to match any media (e.g., "image/png", "text/*")
-
getAllowedMimetypes
public List<String> getAllowedMimetypes(org.xwiki.model.reference.DocumentReference documentReference)
- Parameters:
documentReference
- the reference of a document- Returns:
- the list of allowed attachment mimetypes of the provided document. A joker (@code '*') can be used to match any media (e.g., "image/png", "text/*")
- Since:
- 14.10.2, 15.0RC1
-
getBlockerMimetypes
public List<String> getBlockerMimetypes()
- Returns:
- the list of blocker attachment mimetype of the current document. A joker (@code '*') can be used to match any media (e.g., "image/png", "text/*")
-
getBlockerMimetypes
public List<String> getBlockerMimetypes(org.xwiki.model.reference.DocumentReference documentReference)
- Parameters:
documentReference
- the reference of a document- Returns:
- the list of blocker attachment mimetypes of the provided document. A joker (@code '*') can be used to match any media (e.g., "image/png", "text/*")
- Since:
- 14.10.2, 15.0RC1
-
getUploadMaxSize
public long getUploadMaxSize(org.xwiki.model.reference.EntityReference entityReference)
- Parameters:
entityReference
- the entity reference to use as the context when resolving the configuration, or the current entity ofnull
- Returns:
- the maximum file size allowed for a given entity, in bytes
- Since:
- 15.5RC1, 14.10.13
-
getUploadMaxSize
public long getUploadMaxSize()
- Returns:
- the maximum file size allowed for the current document, in bytes
- Since:
- 15.5RC1, 14.10.13
-
-