Interface RequestContext
-
- All Known Implementing Classes:
AbstractRequestContext
public interface RequestContext
Abstracts access to the request information needed for file uploads.This interface should be implemented for each type of request that may be handled by FileUpload, such as servlets and portlets.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.lang.StringgetCharacterEncoding()Gets the character encoding for the request.default java.nio.charset.CharsetgetCharset()Gets the character encoding for the request or null if unspecified.longgetContentLength()Gets the content length of the request.java.lang.StringgetContentType()Gets the content type of the request.java.io.InputStreamgetInputStream()Gets the input stream for the request.booleanisMultipartRelated()Is the Request of typemultipart/related?
-
-
-
Method Detail
-
getCharacterEncoding
java.lang.String getCharacterEncoding()
Gets the character encoding for the request.- Returns:
- The character encoding for the request.
-
getCharset
default java.nio.charset.Charset getCharset() throws java.nio.charset.UnsupportedCharsetException
Gets the character encoding for the request or null if unspecified.- Returns:
- The character encoding for the request or null.
- Throws:
java.nio.charset.UnsupportedCharsetException- If the named Charset is unavailable.
-
getContentLength
long getContentLength()
Gets the content length of the request.- Returns:
- The content length of the request.
-
getContentType
java.lang.String getContentType()
Gets the content type of the request.- Returns:
- The content type of the request.
-
getInputStream
java.io.InputStream getInputStream() throws java.io.IOException
Gets the input stream for the request.- Returns:
- The input stream for the request.
- Throws:
java.io.IOException- if a problem occurs.
-
isMultipartRelated
boolean isMultipartRelated()
Is the Request of typemultipart/related?- Returns:
- the Request is of type
multipart/related - Since:
- 2.0.0
-
-