Package org.apache.commons.fileupload

Examples of org.apache.commons.fileupload.LiferayFileItem


      diskFileUpload.setSizeMax(DEFAULT_SIZE_MAX);

      List list = diskFileUpload.parseRequest(req);

      for (int i = 0; i < list.size(); i++) {
        LiferayFileItem fileItem = (LiferayFileItem)list.get(i);

        if (fileItem.isFormField()) {
          fileItem.setString(req.getCharacterEncoding());
              }

        LiferayFileItem[] fileItems =
          (LiferayFileItem[])_params.get(fileItem.getFieldName());

        if (fileItems == null) {
          fileItems = new LiferayFileItem[] {fileItem};
        }
        else {
          LiferayFileItem[] newFileItems =
            new LiferayFileItem[fileItems.length + 1];

          System.arraycopy(
            fileItems, 0, newFileItems, 0, fileItems.length);

          newFileItems[newFileItems.length - 1] = fileItem;

          fileItems = newFileItems;
        }

        _params.put(fileItem.getFieldName(), fileItems);
        if(fileItem.getFileName() != null)
          _params.put(fileItem.getFileName(), new LiferayFileItem[] {fileItem});

      }
    }
    catch (FileUploadException fue) {
      Logger.error(this,fue.getMessage(),fue);
View Full Code Here

TOP

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

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.