Class DataHandler


  • public class DataHandler
    extends java.lang.Object
    Maps a MIME type into an instance of a DataContentHandler.
    Since:
    TotalCross 1.13
    • Constructor Summary

      Constructors 
      Constructor Description
      DataHandler()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void addDataContentHandler​(DataContentHandler dataContentHandler, java.lang.String mimeType)
      May be used to add an user-defined DataContentHandler, associated to a specific MIME type.
      static DataContentHandler getDataContentHandler​(java.lang.String mimeType)
      Retrieves the DataContentHandler associated with the given MIME type, returning a BinaryContentHandler if the given MIME type is not mapped to any handler.
      • Methods inherited from class java.lang.Object

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

      • DataHandler

        public DataHandler()
    • Method Detail

      • addDataContentHandler

        public static void addDataContentHandler​(DataContentHandler dataContentHandler,
                                                 java.lang.String mimeType)
        May be used to add an user-defined DataContentHandler, associated to a specific MIME type.
        Parameters:
        dataContentHandler - the user-defined DataContentHandler to be added
        mimeType - the MIME type this DataContentHandler should be associated to
        Since:
        TotalCross 1.13
      • getDataContentHandler

        public static DataContentHandler getDataContentHandler​(java.lang.String mimeType)
        Retrieves the DataContentHandler associated with the given MIME type, returning a BinaryContentHandler if the given MIME type is not mapped to any handler.
        Parameters:
        mimeType - MIME type of the content that we need to be handled
        Returns:
        the requested DataContentHandler, or a BinaryContentHandler if the given MIME type is not mapped to any handler.
        Since:
        TotalCross 1.13