01: // Copyright 2007 The Apache Software Foundation
02: //
03: // Licensed under the Apache License, Version 2.0 (the "License");
04: // you may not use this file except in compliance with the License.
05: // You may obtain a copy of the License at
06: //
07: // http://www.apache.org/licenses/LICENSE-2.0
08: //
09: // Unless required by applicable law or agreed to in writing, software
10: // distributed under the License is distributed on an "AS IS" BASIS,
11: // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12: // See the License for the specific language governing permissions and
13: // limitations under the License.
14: package org.apache.tapestry.upload.services;
15:
16: import javax.servlet.http.HttpServletRequest;
17:
18: /**
19: * Responsible for detecting and processing file upload requests, using Jakarta Commons FileUpload.
20: * Implementations of this service typically use the threaded service lifecycle model.
21: */
22: public interface MultipartDecoder {
23:
24: /**
25: * @param parameterName
26: * Name of the query parameter associated with the uploaded file
27: * @return a file upload with the given name, or null if no such file upload was in the request.
28: */
29: UploadedFile getFileUpload(String parameterName);
30:
31: /**
32: * Decodes the request, returning a new {@link javax.servlet.http.HttpServletRequest}
33: * implementation that will allow access to the form fields submitted in the request (but omits
34: * uploaded files).
35: *
36: * @param request
37: * The incoming servlet request
38: * @return decoded http request
39: */
40: HttpServletRequest decode(HttpServletRequest request);
41: }
|