Package org.apache.commons.fileupload

Examples of org.apache.commons.fileupload.DiskFileUpload.parseRequest()


            try {
                // Create a new file upload handler
                DiskFileUpload upload = new DiskFileUpload();

                List items = upload.parseRequest(req);

                // Process the uploaded items
                Iterator iter = items.iterator();
                while (iter.hasNext()) {
                    FileItem item = (FileItem) iter.next();
View Full Code Here


        HashMap formInput = new HashMap();
        results.put("formInput", formInput);
        DiskFileUpload fu = new DiskFileUpload();
        java.util.List lst = null;
        try {
           lst = fu.parseRequest(request);
        } catch (FileUploadException e4) {
            return ServiceUtil.returnError(e4.getMessage());
        }

        if (lst.size() == 0) {
View Full Code Here

        try
        {
            if (encoding != null)
                upload.setHeaderEncoding(encoding);
            parts = upload.parseRequest(request, _thresholdSize, _maxSize, _repositoryPath);
        }
        catch (FileUploadException ex)
        {
            throw new ApplicationRuntimeException(
                Tapestry.format("DefaultMultipartDecoder.unable-to-decode", ex.getMessage()),
View Full Code Here

        try
        {
            if (encoding != null)
                upload.setHeaderEncoding(encoding);
            parts = upload.parseRequest(request, _thresholdSize, _maxSize, _repositoryPath);
        }
        catch (FileUploadException ex)
        {
            throw new ApplicationRuntimeException(
                Tapestry.format("DefaultMultipartDecoder.unable-to-decode", ex.getMessage()),
View Full Code Here

      webCtx.setCurrentWorkspace(workspace);

      Node parentFolder = (Node)webCtx.getSession().getItem(currentFolderStr);

      DiskFileUpload upload = new DiskFileUpload();
      List items = upload.parseRequest(request);

      Map fields = new HashMap();

      Iterator iter = items.iterator();
      while (iter.hasNext())
View Full Code Here

    // Set the the location for saving data on disk.
    upload.setRepositoryPath(getRepositoryPath(servletContext));

    List<FileItem> items = null;
    try {
      items = upload.parseRequest(request);

    } catch (DiskFileUpload.SizeLimitExceededException e) {
      if (log.isErrorEnabled()) {
        log.error("Size limit exceeded exception");
      }
View Full Code Here

        // STEP 1. GATHER UPLOADED ITEMS
        // Create a new file upload handler
        DiskFileUpload upload = new DiskFileUpload();

        // Parse the request
        List<FileItem> items = upload.parseRequest(req);
        Iterator<FileItem> iter = items.iterator();
        while (iter.hasNext()) {
          FileItem item = (FileItem) iter.next();

          if (!item.isFormField()) {
View Full Code Here

      webCtx.setCurrentWorkspace(workspace);

      Node parentFolder = (Node)webCtx.getSession().getItem(currentFolderStr);

      DiskFileUpload upload = new DiskFileUpload();
      List items = upload.parseRequest(request);

      Map fields = new HashMap();

      Iterator iter = items.iterator();
      while (iter.hasNext())
View Full Code Here

        // Parse the request into file items.
        List items = null;

        try {
            items = upload.parseRequest(request);
        } catch (DiskFileUpload.SizeLimitExceededException e) {
            // Special handling for uploads that are too big.
            request.setAttribute(MultipartRequestHandler.ATTRIBUTE_MAX_LENGTH_EXCEEDED,
                Boolean.TRUE);
View Full Code Here

      fileUpload.setSizeMax(1024 * 1024);
      fileUpload.setRepositoryPath(System.getProperty("java.io.tmpdir"));
      // TODO: make sizeMax and repositoryPath configurable
      List itemList;
      try {
        itemList = fileUpload.parseRequest(request);
      } catch (FileUploadException e) {
        LOG.error(e);
        throw new FacesException(e);
      }
      if (LOG.isDebugEnabled()) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.