Class ComponentFileFilterParameter


  • public class ComponentFileFilterParameter
    extends Object
    This class handles component file filters (authorized or forbidden files).
    Author:
    Yohann Chastagnier Date: 17/12/12
    • Method Detail

      • isAuthorization

        public boolean isAuthorization()
        Indicates if getMimeTypes returns authorized or forbidden files.
        Returns:
        true for authorized files, false for forbidden files.
      • getFileFilters

        public String getFileFilters()
        Gets the current file filter.
        Returns:
        the current filter filename.
      • isFileFilterGloballySet

        public boolean isFileFilterGloballySet()
        Indicates if the file filter is set globally.
        Returns:
        true if the file filter is set globally, false otherwise.
      • isFileAuthorized

        public boolean isFileAuthorized​(File file)
        Checks if the given file is authorized. If parameter is null, it is considered as forbidden.
        Parameters:
        file - the file
        Returns:
        true if the specified file is authorized, false otherwise.
      • verifyFileAuthorized

        public void verifyFileAuthorized​(File file)
        Throwing the component file filter exception (RuntimeException) if file is forbidden.
        Parameters:
        file - the file
      • isMimeTypeAuthorized

        public boolean isMimeTypeAuthorized​(String mimeType)
        Checks if the given mime type is authorized. If parameter is null, it is considered as forbidden.
        Parameters:
        mimeType - the mime-type
        Returns:
        true if the mime-type is authorized, false otherwise.