Package org.apache.commons.fileupload

Examples of org.apache.commons.fileupload.FileUploadException


                    String encoding = request.getCharacterEncoding();
                    String value1 = encoding == null ? item.getString() : item.getString(encoding);
                    list1.add(value1);
                }
                catch(UnsupportedEncodingException e){
                    throw new FileUploadException(e.getMessage());
                }
            }
            else{
                List<MultipartFile> list2 = tmpFiles.get(item.getFieldName());
                if (list2 == null){
View Full Code Here


    private List parseMultipartRequest() throws FileUploadException {

        // Check that we have a file upload request
        boolean isMultipart = FileUploadBase.isMultipartContent(this);
        if (!isMultipart) {
            throw new FileUploadException("Not a multipart request: "
                    + this.getContentType());
        }

        // Create a new file upload handler
        DiskFileUpload upload = new DiskFileUpload();
View Full Code Here

    {
      log.warn("No files were found when processing the requst. Debugging info follows.");

      writeDebugInfo(request);

      throw new FileUploadException("No files were found when processing the requst.");
    }
    else
    {
      if (log.isDebugEnabled())
      {
View Full Code Here

      for (FileItem fileItem : fileItems)
      {
        if (fileItem.getSize() > maxSize.bytes())
        {
          String fieldName = entry.getKey();
          FileUploadException fslex = new FileUploadBase.FileSizeLimitExceededException("The field " +
              fieldName + " exceeds its maximum permitted " + " size of " +
              maxSize + " characters.", fileItem.getSize(), maxSize.bytes());
          throw fslex;
        }
      }
View Full Code Here

            } else {
                /*
                 * For whatever reason we cannot write the
                 * file to disk.
                 */
                throw new FileUploadException(
                    "Cannot write uploaded file to disk!");
            }
        }
    }
View Full Code Here

            } else {
                /*
                 * For whatever reason we cannot write the
                 * file to disk.
                 */
                throw new FileUploadException(
                    "Cannot write uploaded file to disk!");
            }
        }
    }
View Full Code Here

        if (!(exception instanceof FileUploadException)) {
            return;
        }

        FileUploadException fue = (FileUploadException) exception;

        String key = null;
        Object args[] = null;

        if (fue instanceof SizeLimitExceededException) {
            SizeLimitExceededException se =
                (SizeLimitExceededException) fue;

            key = "post-size-limit-exceeded-error";

            args = new Object[2];
            args[0] = new Long(se.getPermittedSize());
            args[1] = new Long(se.getActualSize());
            setError(getMessage(key, args));

        } else if (fue instanceof FileSizeLimitExceededException) {
            FileSizeLimitExceededException fse =
                (FileSizeLimitExceededException) fue;

            key = "file-size-limit-exceeded-error";

            // Parse the FileField name from the message
            String msg = fue.getMessage();
            int start = 10;
            int end = msg.indexOf(' ', start);
            String fieldName = fue.getMessage().substring(start, end);

            args = new Object[3];
            args[0] = ClickUtils.toLabel(fieldName);
            args[1] = new Long(fse.getPermittedSize());
            args[2] = new Long(fse.getActualSize());
View Full Code Here

    @Override
    public void handle(ComponentEventRequestParameters parameters, ComponentEventRequestHandler handler)
            throws IOException
    {
        FileUploadException uploadException = decoder.getUploadException();

        if (uploadException != null)
        {
            Component page = componentSource.getPage(parameters.getActivePageName());
View Full Code Here

    {
      log.warn("No files were found when processing the requst. Debugging info follows.");

      writeDebugInfo(request);

      throw new FileUploadException("No files were found when processing the requst.");
    }
    else
    {
      if (log.isDebugEnabled())
      {
View Full Code Here

            } else {
                /*
                 * For whatever reason we cannot write the
                 * file to disk.
                 */
                throw new FileUploadException(
                    "Cannot write uploaded file to disk!");
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.commons.fileupload.FileUploadException

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.