eXo JCR :: Component :: Webdav Service 1.15.4-GA

org.exoplatform.services.jcr.webdav
Class MimeTypeRecognizer

java.lang.Object
  extended by 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
MimeTypeRecognizer(String fileName, org.exoplatform.commons.utils.MimeTypeResolver mimeTypeResolver, javax.ws.rs.core.MediaType mediaType, boolean untrustedAgent)
          Constructor
 
Method Summary
 String getEncoding()
          Returns encoding according to MediaType or null no encoding set or MediaType is no available.
 String getMimeType()
          Returns mime-type of a resource according to MediaType or MimeTypeResolver information.
 boolean isEncodingSet()
          Shows if encoding is set via MediaType.
 boolean isMimeTypeRecognized()
          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 Detail

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 Detail

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.


eXo JCR :: Component :: Webdav Service 1.15.4-GA

Copyright © 2013 eXo Platform SAS. All Rights Reserved.