01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17: package org.apache.wicket.util.upload;
18:
19: import java.io.IOException;
20: import java.io.InputStream;
21:
22: /**
23: * <p>
24: * Abstracts access to the request information needed for file uploads. This
25: * interfsace should be implemented for each type of request that may be handled
26: * by FileUpload, such as servlets and portlets.
27: * </p>
28: *
29: * @author <a href="mailto:martinc@apache.org">Martin Cooper</a>
30: */
31: public interface RequestContext {
32:
33: /**
34: * Retrieve the content type of the request.
35: *
36: * @return The content type of the request.
37: */
38: String getContentType();
39:
40: /**
41: * Retrieve the content length of the request.
42: *
43: * @return The content length of the request.
44: */
45: int getContentLength();
46:
47: /**
48: * Retrieve the input stream for the request.
49: *
50: * @return The input stream for the request.
51: *
52: * @throws IOException
53: * if a problem occurs.
54: */
55: InputStream getInputStream() throws IOException;
56: }
|