1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.apache.commons.fileupload;
17
18 import java.io.InputStream;
19 import java.io.IOException;
20
21 /***
22 * <p>Abstracts access to the request information needed for file uploads. This
23 * interfsace should be implemented for each type of request that may be
24 * handled by FileUpload, such as servlets and portlets.</p>
25 *
26 * @author <a href="mailto:martinc@apache.org">Martin Cooper</a>
27 *
28 * @since FileUpload 1.1
29 *
30 * @version $Id: RequestContext.java 349366 2005-11-28 04:44:57Z martinc $
31 */
32 public interface RequestContext {
33
34 /***
35 * Retrieve the character encoding for the request.
36 *
37 * @return The character encoding for the request.
38 */
39 String getCharacterEncoding();
40
41 /***
42 * Retrieve the content type of the request.
43 *
44 * @return The content type of the request.
45 */
46 String getContentType();
47
48 /***
49 * Retrieve the content length of the request.
50 *
51 * @return The content length of the request.
52 */
53 int getContentLength();
54
55 /***
56 * Retrieve the input stream for the request.
57 *
58 * @return The input stream for the request.
59 *
60 * @throws IOException if a problem occurs.
61 */
62 InputStream getInputStream() throws IOException;
63 }