001/* 002 * Copyright 2002-2011 the original author or authors. 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * https://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016 017package org.springframework.web.multipart; 018 019import javax.servlet.http.HttpServletRequest; 020 021import org.springframework.http.HttpHeaders; 022import org.springframework.http.HttpMethod; 023import org.springframework.lang.Nullable; 024 025/** 026 * Provides additional methods for dealing with multipart content within a 027 * servlet request, allowing to access uploaded files. 028 * Implementations also need to override the standard 029 * {@link javax.servlet.ServletRequest} methods for parameter access, making 030 * multipart parameters available. 031 * 032 * <p>A concrete implementation is 033 * {@link org.springframework.web.multipart.support.DefaultMultipartHttpServletRequest}. 034 * As an intermediate step, 035 * {@link org.springframework.web.multipart.support.AbstractMultipartHttpServletRequest} 036 * can be subclassed. 037 * 038 * @author Juergen Hoeller 039 * @author Trevor D. Cook 040 * @since 29.09.2003 041 * @see MultipartResolver 042 * @see MultipartFile 043 * @see javax.servlet.http.HttpServletRequest#getParameter 044 * @see javax.servlet.http.HttpServletRequest#getParameterNames 045 * @see javax.servlet.http.HttpServletRequest#getParameterMap 046 * @see org.springframework.web.multipart.support.DefaultMultipartHttpServletRequest 047 * @see org.springframework.web.multipart.support.AbstractMultipartHttpServletRequest 048 */ 049public interface MultipartHttpServletRequest extends HttpServletRequest, MultipartRequest { 050 051 /** 052 * Return this request's method as a convenient HttpMethod instance. 053 */ 054 @Nullable 055 HttpMethod getRequestMethod(); 056 057 /** 058 * Return this request's headers as a convenient HttpHeaders instance. 059 */ 060 HttpHeaders getRequestHeaders(); 061 062 /** 063 * Return the headers associated with the specified part of the multipart request. 064 * <p>If the underlying implementation supports access to headers, then all headers are returned. 065 * Otherwise, the returned headers will include a 'Content-Type' header at the very least. 066 */ 067 @Nullable 068 HttpHeaders getMultipartHeaders(String paramOrFileName); 069 070}