01: /*
02: * Copyright 2005 Joe Walker
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16: package org.directwebremoting.dwrp;
17:
18: import java.io.IOException;
19: import java.util.Map;
20:
21: import javax.servlet.http.HttpServletRequest;
22:
23: import org.directwebremoting.extend.FormField;
24: import org.directwebremoting.extend.ServerException;
25:
26: /**
27: * An interface to allow us to plug alternative FileUpload components into DWR,
28: * and more specifically, to plug in a null implementation if file commons
29: * file-upload.jar is not available on the classpath.
30: * @author Joe Walker [joe at getahead dot ltd dot uk]
31: */
32: public interface FileUpload {
33: /**
34: * Process an inbound request into a set of name/value pairs where the
35: * values could be file uploads.
36: * @param req The request to parse
37: * @return A map of the fields in the input request
38: * @throws ServerException If there is an {@link IOException} while reading the request
39: */
40: public Map<String, FormField> parseRequest(HttpServletRequest req)
41: throws ServerException;
42: }
|