Class MimeTypeRecognizer

java.lang.Object
org.exoplatform.services.jcr.webdav.MimeTypeRecognizer

public class MimeTypeRecognizer extends Object
Provides means to recognize mime-type information of the content (including mime-type itself and encoding)
Version:
$Id: MimeTypeRecognizer.java 23.08.2012 dkuleshov $
Author:
Dmitry Kuleshov
  • Constructor Summary

    Constructors
    Constructor
    Description
    MimeTypeRecognizer(String fileName, org.exoplatform.commons.utils.MimeTypeResolver mimeTypeResolver, javax.ws.rs.core.MediaType mediaType, boolean untrustedAgent)
    Constructor
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns encoding according to MediaType or null no encoding set or MediaType is no available.
    Returns mime-type of a resource according to MediaType or MimeTypeResolver information.
    boolean
    Shows if encoding is set via MediaType.
    boolean
    Shows if mime-type is recognized by MimeTypeResolver.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • MimeTypeRecognizer

      public MimeTypeRecognizer(String fileName, org.exoplatform.commons.utils.MimeTypeResolver mimeTypeResolver, javax.ws.rs.core.MediaType mediaType, boolean untrustedAgent)
      Constructor
      Parameters:
      fileName - - short name of the resource
      mimeTypeResolver - - provides means to resolve mime-type
      mediaType - - media type instance (stores mime-type and encoding)
      untrustedAgent - - shows if agent to provide resource and it's mime type is listed as trusted (no mime-type change is allowed for untrusted agents)
  • Method Details

    • isMimeTypeRecognized

      public boolean isMimeTypeRecognized()
      Shows if mime-type is recognized by MimeTypeResolver.
    • isEncodingSet

      public boolean isEncodingSet()
      Shows if encoding is set via MediaType.
    • getMimeType

      public String getMimeType()
      Returns mime-type of a resource according to MediaType or MimeTypeResolver information.
    • getEncoding

      public String getEncoding()
      Returns encoding according to MediaType or null no encoding set or MediaType is no available.