Class ServletRequestContext

  • All Implemented Interfaces:
    RequestContext, UploadContext

    public class ServletRequestContext
    extends java.lang.Object
    implements UploadContext

    Provides access to the request information needed for a request made to an HTTP servlet.

    Since:
    FileUpload 1.1
    • Constructor Detail

      • ServletRequestContext

        public ServletRequestContext​(HttpServletRequest request)
        Construct a context for this request.
        Parameters:
        request - The request to which this context applies.
    • Method Detail

      • getCharacterEncoding

        public java.lang.String getCharacterEncoding()
        Retrieve the character encoding for the request.
        Specified by:
        getCharacterEncoding in interface RequestContext
        Returns:
        The character encoding for the request.
      • getContentType

        public java.lang.String getContentType()
        Retrieve the content type of the request.
        Specified by:
        getContentType in interface RequestContext
        Returns:
        The content type of the request.
      • getContentLength

        @Deprecated
        public int getContentLength()
        Deprecated.
        1.3 Use contentLength() instead
        Retrieve the content length of the request.
        Specified by:
        getContentLength in interface RequestContext
        Returns:
        The content length of the request.
      • contentLength

        public long contentLength()
        Retrieve the content length of the request.
        Specified by:
        contentLength in interface UploadContext
        Returns:
        The content length of the request.
        Since:
        1.3
      • getInputStream

        public java.io.InputStream getInputStream()
                                           throws java.io.IOException
        Retrieve the input stream for the request.
        Specified by:
        getInputStream in interface RequestContext
        Returns:
        The input stream for the request.
        Throws:
        java.io.IOException - if a problem occurs.
      • toString

        public java.lang.String toString()
        Returns a string representation of this object.
        Overrides:
        toString in class java.lang.Object
        Returns:
        a string representation of this object.