Package org.apache.commons.fileupload.servlet

Examples of org.apache.commons.fileupload.servlet.ServletRequestContext


            // read and set http parameters
            parseParameters(request, reqtrans, encoding);

            // read file uploads
            List uploads = null;
            ServletRequestContext reqcx = new ServletRequestContext(request);

            if (ServletFileUpload.isMultipartContent(reqcx)) {
                // get session for upload progress monitoring
                UploadStatus uploadStatus = getApplication().getUploadStatus(reqtrans);
                try {
View Full Code Here


* @author Vlad Ilyushchenko
*/
public class UploadWarController extends TomcatContainerController {

    protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response) throws Exception {
        if (FileUpload.isMultipartContent(new ServletRequestContext(request))) {

            File tmpWar = null;
            String contextName = null;
            boolean update = false;
            boolean compile = false;
View Full Code Here

                    this.requestDataUsed = true;
                    useFallback = false;
                }

                // Multipart POST
                if (ServletFileUpload.isMultipartContent(new ServletRequestContext(this.getServletRequest()))) {
                    this.parseMultiPartPost(parameters);
                    this.requestDataUsed = true;
                    useFallback = false;
                }
            }
View Full Code Here

        upload.setSizeMax(ParameterSupport.maxRequestSize);
        upload.setFileSizeMax(ParameterSupport.maxFileSize);
        upload.setFileItemFactory(new DiskFileItemFactory(ParameterSupport.fileSizeThreshold,
            ParameterSupport.location));

        RequestContext rc = new ServletRequestContext(this.getServletRequest()) {
            @Override
            public String getCharacterEncoding() {
                String enc = super.getCharacterEncoding();
                return (enc != null) ? enc : Util.ENCODING_DIRECT;
            }
View Full Code Here

            this.dumpRepository(req.getParameterValues("bundle"), resp);
            resp.sendRedirect(req.getRequestURI());
            return;
        }

        if (!ServletFileUpload.isMultipartContent(new ServletRequestContext(req))) {
            resp.sendRedirect(req.getRequestURI());
            return;
        }

        // Create a factory for disk-based file items
View Full Code Here

     *  is returned.
     */
    public static final String getParameter( HttpServletRequest request, String name )
    {
        // just get the parameter if not a multipart/form-data POST
        if ( !FileUploadBase.isMultipartContent( new ServletRequestContext( request ) ) )
        {
            return request.getParameter( name );
        }

        // check, whether we already have the parameters
View Full Code Here

    final List<FileItem> items;

    if (wantUploadProgressUpdates())
    {
      ServletRequestContext ctx = new ServletRequestContext(request)
      {
        @Override
        public InputStream getInputStream() throws IOException
        {
          return new CountingInputStream(super.getInputStream());
View Full Code Here

            getContainerParameters(parameters);

            // only read input in case of multipart-POST not handled
            // by the servlet container
            if ("POST".equals(this.getServletRequest().getMethod())) {
                if (ServletFileUpload.isMultipartContent(new ServletRequestContext(
                    this.getServletRequest()))) {
                    this.parseMultiPartPost(parameters);
                    this.requestDataUsed = true;
                }
            }
View Full Code Here

        // Create a new file upload handler
        ServletFileUpload upload = new ServletFileUpload(factory);
        upload.setSizeMax(-1);

        RequestContext rc = new ServletRequestContext(this.getServletRequest()) {
            public String getCharacterEncoding() {
                String enc = super.getCharacterEncoding();
                return (enc != null) ? enc : Util.ENCODING_DIRECT;
            }
        };
View Full Code Here

     *
     * @deprecated Use the method in <code>ServletFileUpload</code> instead.
     */
    public List /* FileItem */ parseRequest(HttpServletRequest req)
            throws FileUploadException {
        return parseRequest(new ServletRequestContext(req));
    }
View Full Code Here

TOP

Related Classes of org.apache.commons.fileupload.servlet.ServletRequestContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.