Class HeaderUtils


  • public class HeaderUtils
    extends Object
    Provides utilities to handle HTTP headers.
    • Method Detail

      • createContentDispositionValue

        public static String createContentDispositionValue​(String filename)
        Returns a HTTP 'Content-Disposition' header value for the specified file name.
        Parameters:
        filename - the file name to set as a 'Content-Disposition' header value
        Returns:
        the 'Content-Disposition' header value.
      • createContentDispositionValue

        public static String createContentDispositionValue​(File file)
        Returns a HTTP 'Content-Disposition' header value for the specified file.
        Parameters:
        file - the file to set as a 'Content-Disposition' header value
        Returns:
        the 'Content-Disposition' header value.
      • getContentDispositionFilename

        public static String getContentDispositionFilename​(String value)
        Returns the file name set as 'Content-Disposition' header value.
        Parameters:
        value - the 'Content-Disposition' header value.
        Returns:
        the file name specified in the 'Content-Disposition' header value, null if none.