Class StorageUtil


  • public final class StorageUtil
    extends java.lang.Object
    A utility for storage needs.
    Author:
    Ween Jiann Lee
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String getFileExtension​(Response response)
      Get file extension from a response.
      static java.lang.String getFileExtension​(java.lang.String mimeTypeStr)
      Get file extension from mime type name.
      • Methods inherited from class java.lang.Object

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

      • getFileExtension

        public static java.lang.String getFileExtension​(Response response)
                                                 throws org.apache.tika.mime.MimeTypeException
        Get file extension from a response.
        Parameters:
        response - an instance of response
        Returns:
        file extension for response content
        Throws:
        org.apache.tika.mime.MimeTypeException - if the given media type name is invalid
      • getFileExtension

        public static java.lang.String getFileExtension​(java.lang.String mimeTypeStr)
                                                 throws org.apache.tika.mime.MimeTypeException
        Get file extension from mime type name.
        Parameters:
        mimeTypeStr - mime type name
        Returns:
        file extension for response content
        Throws:
        org.apache.tika.mime.MimeTypeException - if the given media type name is invalid