Class 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 Detail

      • AttachmentValidationScriptService

        public AttachmentValidationScriptService()
    • 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 of null
        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