Coverage Report - org.apache.tapestry.multipart.IMultipartDecoder
 
Classes in this File Line Coverage Branch Coverage Complexity
IMultipartDecoder
N/A
N/A
1
 
 1  
 // Copyright 2004, 2005 The Apache Software Foundation
 2  
 //
 3  
 // Licensed under the Apache License, Version 2.0 (the "License");
 4  
 // you may not use this file except in compliance with the License.
 5  
 // You may obtain a copy of the License at
 6  
 //
 7  
 //     http://www.apache.org/licenses/LICENSE-2.0
 8  
 //
 9  
 // 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  
 
 15  
 package org.apache.tapestry.multipart;
 16  
 
 17  
 import javax.servlet.http.HttpServletRequest;
 18  
 
 19  
 import org.apache.tapestry.request.IUploadFile;
 20  
 
 21  
 /**
 22  
  * Defines how a multipart HTTP request can be broken into individual elements
 23  
  * (including file uploads).
 24  
  * <p>
 25  
  * Multipart decoder implementations must be threadsafe.
 26  
  * 
 27  
  * @author Howard Lewis Ship
 28  
  * @since 2.3
 29  
  */
 30  
 
 31  
 public interface IMultipartDecoder
 32  
 {
 33  
 
 34  
     /**
 35  
      * Decodes the incoming request, identifying all the parts (values and
 36  
      * uploaded files) contained within.
 37  
      */
 38  
 
 39  
     void decode(HttpServletRequest request);
 40  
 
 41  
     /**
 42  
      * Invoked to release any resources needed by tghe decoder. In some cases,
 43  
      * large incoming parts are written to temporary files; this method ensures
 44  
      * those temporary files are deleted.
 45  
      */
 46  
 
 47  
     void cleanup(HttpServletRequest request);
 48  
 
 49  
     /**
 50  
      * Returns the single value (or first value) for the parameter with the
 51  
      * specified name. Returns null if no such parameter was in the request.
 52  
      */
 53  
 
 54  
     String getString(HttpServletRequest request, String name);
 55  
 
 56  
     /**
 57  
      * Returns an array of values (possibly a single element array). Returns
 58  
      * null if no such parameter was in the request.
 59  
      */
 60  
 
 61  
     String[] getStrings(HttpServletRequest request, String name);
 62  
 
 63  
     /**
 64  
      * Returns the uploaded file with the specified parameter name, or null if
 65  
      * no such parameter was in the request.
 66  
      */
 67  
 
 68  
     IUploadFile getUploadFile(HttpServletRequest request, String name);
 69  
 
 70  
     /**
 71  
      * Returns the names of all parameters whose type is string (not file
 72  
      * upload).
 73  
      * 
 74  
      * @since 4.0
 75  
      */
 76  
     String[] getStringParameterNames(HttpServletRequest request);
 77  
 }