Class ElFinderUploadMime

java.lang.Object
de.xima.fc.gui.elfinder.ElFinderUploadMime
All Implemented Interfaces:
Serializable

public final class ElFinderUploadMime extends Object implements Serializable
Model and utility class for the upload mime configuration of the ElFinder file manager.
Since:
8.3.0
Author:
XIMA MEDIA GmbH
See Also:
  • Method Details

    • allowsMimeType

      public boolean allowsMimeType(String mimeType)
      Checks whether this filter matches the given mime type.
      Parameters:
      mimeType - The mime type to check.
      Returns:
      True if the mime type is allowed, false if it is denied.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • getAllow

      public Set<String> getAllow()
      Get the mime types that are allowed.
      Returns:
      The allowed mime types.
    • getDeny

      public Set<String> getDeny()
      Get the mime types that are denied.
      Returns:
      The denied mime types.
    • getFirstOrder

      Get the first order to check for mime types.
      Returns:
      The first order.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • allowAll

      public static ElFinderUploadMime allowAll()
      Allows all mime types.
      Returns:
      An upload mime configuration that allows all mime types.
    • allowAllExcept

      public static ElFinderUploadMime allowAllExcept(Set<String> deniedMimeTypes)
      Allows all mime types except for the given ones. This is effectively a blacklist of mime types.
      Parameters:
      deniedMimeTypes - The mime types to deny.
      Returns:
      The upload mime configuration.
    • custom

      public static ElFinderUploadMime custom(ElFinderUploadMime.EElFinderFirstOrder firstOrder, Set<String> allow, Set<String> deny)
      Creates a new upload mime configuration with the given parameters. Usually one of the static factory methods should suffice.
      Parameters:
      firstOrder - The first order to check for mime types.
      allow - The mime types to allow.
      deny - The mime types to deny.
      Returns:
      The upload mime configuration.
    • denyAll

      public static ElFinderUploadMime denyAll()
      Denies all mime types.
      Returns:
      An upload mime configuration that denies all mime types.
    • denyAllExcept

      public static ElFinderUploadMime denyAllExcept(Set<String> allowedMimeTypes)
      Denies all mime types except for the given ones. This is effectively a whitelist of mime types.
      Parameters:
      allowedMimeTypes - The mime types to allow.
      Returns:
      The upload mime configuration.