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.util.Map;
19:
20: import javax.servlet.http.HttpServletRequest;
21:
22: import org.apache.commons.logging.Log;
23: import org.apache.commons.logging.LogFactory;
24: import org.directwebremoting.extend.FormField;
25: import org.directwebremoting.extend.ServerException;
26:
27: /**
28: * A default implementation of FileUpload for cases when Commons File-Upload is
29: * not available. This implementation does not do file uploads, however it does
30: * allow the system to carry on without classpath issues.
31: * @author Joe Walker [joe at getahead dot ltd dot uk]
32: */
33: public class UnsupportedFileUpload implements FileUpload {
34: /* (non-Javadoc)
35: * @see org.directwebremoting.dwrp.FileUpload#parseRequest(javax.servlet.http.HttpServletRequest, java.io.File)
36: */
37: public Map<String, FormField> parseRequest(HttpServletRequest req)
38: throws ServerException {
39: log
40: .error("Commons File Upload jar file not found. Aborting request.");
41: throw new UnsupportedOperationException(
42: "File uploads not supported");
43: }
44:
45: /**
46: * The log stream
47: */
48: private static final Log log = LogFactory
49: .getLog(UnsupportedFileUpload.class);
50: }
|