01: /*
02: * JFolder, Copyright 2001-2006 Gary Steinmetz
03: *
04: * Distributable under LGPL license.
05: * See terms of license at gnu.org.
06: */
07:
08: package org.jfolder.common.utils.web;
09:
10: //base classes
11: import java.io.InputStream;
12:
13: //project specific classes
14: import org.jfolder.common.UnexpectedSystemException;
15:
16: //other classes
17: import org.apache.commons.fileupload.RequestContext;
18:
19: public class ParameterRequestContext implements RequestContext {
20:
21: //
22: private InputStream is = null;
23: private String contentType = null;
24: private int contentLength = 0;
25: private String characterEncoding = null;
26:
27: //
28: private ParameterRequestContext(InputStream inIs,
29: String inContentType, int inContentLength,
30: String inCharacterEncoding) {
31: //
32: this .is = inIs;
33: this .contentType = inContentType;
34: this .contentLength = inContentLength;
35: this .characterEncoding = inCharacterEncoding;
36: }
37:
38: public final static ParameterRequestContext newInstance(
39: InputStream inIs, String inContentType,
40: int inContentLength, String inCharacterEncoding) {
41:
42: return new ParameterRequestContext(inIs, inContentType,
43: inContentLength, inCharacterEncoding);
44: }
45:
46: //
47: public String getContentType() {
48: return this .contentType;
49: }
50:
51: public int getContentLength() {
52: return this .contentLength;
53: }
54:
55: public InputStream getInputStream() {
56: return this .is;
57: }
58:
59: public String getCharacterEncoding() {
60: return this.characterEncoding;
61: }
62: }
|