Package org.apache.commons.fileupload.servlet

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


        FileUploadBase upload = new ServletFileUpload();
        upload.setFileItemFactory(new DiskFileItemFactory());
        HttpServletRequest request = new MockHttpServletRequest(pStream,
            pLength, contentType);

        List fileItems = upload.parseRequest(new ServletRequestContext(request));
        return fileItems;
    }
View Full Code Here


        FileUploadBase upload = new ServletFileUpload();
        upload.setFileItemFactory(new DiskFileItemFactory());
        HttpServletRequest request = new MockHttpServletRequest(pStream,
                pLength, contentType);

        return upload.getItemIterator(new ServletRequestContext(request));
    }
View Full Code Here

        FileUploadBase upload = new ServletFileUpload();
        upload.setFileItemFactory(new DiskFileItemFactory());
        HttpServletRequest request = new MockHttpServletRequest(pStream,
            pLength, contentType);

        List fileItems = upload.parseRequest(new ServletRequestContext(request));
        return fileItems;
    }
View Full Code Here

      upload.setHeaderEncoding(encoding);
      //ServletRequestContext c = new ServletRequestContext(pc.getHttpServletRequest());
     
     
      HttpServletRequest req = pc.getHttpServletRequest();
      ServletRequestContext context = new ServletRequestContext(req) {
        public String getCharacterEncoding() {
          return encoding;
        }
      };
     
View Full Code Here

  public MultPartForm(final HttpServletRequest request) throws FileUploadException {
    Assert.notNull(request, "request");
    this.parameters = new HashMap<String, String>();
    this.files = new HashMap<String, FileItem>();

    RequestContext requestContext = new ServletRequestContext(request);

    if (FileUploadBase.isMultipartContent(requestContext)) {
      List<?> items = MultPartForm.upload.parseRequest(requestContext);
      Iterator<?> i = items.iterator();
      while (i.hasNext()) {
View Full Code Here

    }
  }

  public static String getParameter(final HttpServletRequest request, final String parameter) throws FileUploadException {
    String value = null;
    RequestContext requestContext = new ServletRequestContext(request);

    if (FileUploadBase.isMultipartContent(requestContext)) {
      List<?> items = MultPartForm.upload.parseRequest(requestContext);
      Iterator<?> i = items.iterator();
      while (i.hasNext()) {
View Full Code Here

    return value;
  }

  public static InputStream getFile(final HttpServletRequest request, final String parameter) throws FileUploadException, IOException {
    InputStream value = null;
    RequestContext requestContext = new ServletRequestContext(request);

    if (FileUploadBase.isMultipartContent(requestContext)) {
      List<?> items = MultPartForm.upload.parseRequest(requestContext);
      Iterator<?> i = items.iterator();
      while (i.hasNext()) {
View Full Code Here

     * @deprecated Use {@link ServletFileUpload#parseRequest(HttpServletRequest)} instead.
     */
    @Deprecated
    public List<FileItem> parseRequest(HttpServletRequest req)
    throws FileUploadException {
        return parseRequest(new ServletRequestContext(req));
    }
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

            // FileUploadIOException) if the request is longer than the max size
            // allowed by fileupload requests (FileUpload.getSizeMax)
            // But note that if the request does not send proper headers this check
            // just will not do anything and we still have to check it again.
            FileItemIterator iter = fileUpload
                    .getItemIterator(new ServletRequestContext(request));

            FileItemFactory fac = fileUpload.getFileItemFactory();
            if (fac == null)
            {
                throw new NullPointerException(
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.