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;
023
024/**
025 * Provides additional methods for dealing with multipart content within a
026 * servlet request, allowing to access uploaded files.
027 * Implementations also need to override the standard
028 * {@link javax.servlet.ServletRequest} methods for parameter access, making
029 * multipart parameters available.
030 *
031 * <p>A concrete implementation is
032 * {@link org.springframework.web.multipart.support.DefaultMultipartHttpServletRequest}.
033 * As an intermediate step,
034 * {@link org.springframework.web.multipart.support.AbstractMultipartHttpServletRequest}
035 * can be subclassed.
036 *
037 * @author Juergen Hoeller
038 * @author Trevor D. Cook
039 * @since 29.09.2003
040 * @see MultipartResolver
041 * @see MultipartFile
042 * @see javax.servlet.http.HttpServletRequest#getParameter
043 * @see javax.servlet.http.HttpServletRequest#getParameterNames
044 * @see javax.servlet.http.HttpServletRequest#getParameterMap
045 * @see org.springframework.web.multipart.support.DefaultMultipartHttpServletRequest
046 * @see org.springframework.web.multipart.support.AbstractMultipartHttpServletRequest
047 */
048public interface MultipartHttpServletRequest extends HttpServletRequest, MultipartRequest {
049
050        /**
051         * Return this request's method as a convenient HttpMethod instance.
052         */
053        HttpMethod getRequestMethod();
054
055        /**
056         * Return this request's headers as a convenient HttpHeaders instance.
057         */
058        HttpHeaders getRequestHeaders();
059
060        /**
061         * Return the headers associated with the specified part of the multipart request.
062         * <p>If the underlying implementation supports access to headers, then all headers are returned.
063         * Otherwise, the returned headers will include a 'Content-Type' header at the very least.
064         */
065        HttpHeaders getMultipartHeaders(String paramOrFileName);
066
067}