Examples of parseRequest()


Examples of org.apache.commons.fileupload.portlet.PortletFileUpload.parseRequest()

            throw new PortletException("Expected file upload");
        }

        PortletFileUpload uploader = new PortletFileUpload(new DiskFileItemFactory());
        try {
            List items = uploader.parseRequest(request);
            for (Iterator i = items.iterator(); i.hasNext();) {
                FileItem item = (FileItem) i.next();
                if (!item.isFormField()) {
                    File file = File.createTempFile("geronimo-import", "");
                    file.deleteOnExit();
View Full Code Here

Examples of org.apache.commons.fileupload.portlet.PortletFileUpload.parseRequest()

            throw new PortletException("Expected file upload");
        }

        PortletFileUpload uploader = new PortletFileUpload(new DiskFileItemFactory());
        try {
            List<FileItem> items = uploader.parseRequest(request);
            for (FileItem item : items) {
                if (!item.isFormField()) {
                    File file = File.createTempFile("geronimo-import", "");
                    file.deleteOnExit();
                    log.debug("Writing database pool import file to " + file.getAbsolutePath());
View Full Code Here

Examples of org.apache.commons.fileupload.portlet.PortletFileUpload.parseRequest()

        if(actionRequest.getContentType() != null && actionRequest.getContentType().startsWith("multipart/form-data")) {
            files = new HashMap();
            fields = new HashMap();
            PortletFileUpload request = new PortletFileUpload(new DiskFileItemFactory());
            try {
                List items = request.parseRequest(actionRequest);
                for (int i = 0; i < items.size(); i++) {
                    FileItem item = (FileItem) items.get(i);
                    if(item.isFormField()) {
                        if(item.getFieldName().equals(MODE_KEY)) {
                            mode = item.getString();
View Full Code Here

Examples of org.apache.commons.fileupload.portlet.PortletFileUpload.parseRequest()

            throw new PortletException("Expected file upload");
        }

        PortletFileUpload uploader = new PortletFileUpload(new DiskFileItemFactory());
        try {
            List items = uploader.parseRequest(request);
            for (Iterator i = items.iterator(); i.hasNext();) {
                FileItem item = (FileItem) i.next();
                if (!item.isFormField()) {
                    File file = File.createTempFile("geronimo-import", "");
                    file.deleteOnExit();
View Full Code Here

Examples of org.apache.commons.fileupload.servlet.ServletFileUpload.parseRequest()

            FileItemFactory factory = new DiskFileItemFactory(1048000, new File(System.getProperty("java.io.tmpdir")));
            ServletFileUpload upload = new ServletFileUpload(factory);
            upload.setSizeMax(-1);
            upload.setHeaderEncoding("UTF8");
            try {
                for (Iterator it = upload.parseRequest(request).iterator(); it.hasNext();) {
                    FileItem fi = (FileItem) it.next();
                    if (!fi.isFormField()) {
                        if (fi.getName() != null && fi.getName().length() > 0) {
                            tmpWar = new File(System.getProperty("java.io.tmpdir"), FilenameUtils.getName(fi.getName()));
                            fi.write(tmpWar);
View Full Code Here

Examples of org.apache.commons.fileupload.servlet.ServletFileUpload.parseRequest()

    upload.setSizeMax(this.sizeMax);
    upload.setHeaderEncoding("UTF-8");

    Set<String> fileNames = new HashSet<String>();
    try {
      List<MonitoredDiskFileItem> items = upload.parseRequest(hRequest);
      long size;
      String fileName, extName;
      // 上传的路径
      File target = new File(this.isAbsolute ? this.uploadPath : hRequest
          .getSession().getServletContext().getRealPath(this.uploadPath));
View Full Code Here

Examples of org.apache.commons.fileupload.servlet.ServletFileUpload.parseRequest()

    upload.setFileSizeMax(this.fileSizeMax);
    upload.setSizeMax(this.sizeMax);
    upload.setHeaderEncoding(charset);

    try {
      List<FileItem> items = upload.parseRequest(request);
      for (FileItem item : items) {
        if (item.isFormField()) {
          try {
            params
                .put(item.getFieldName(), item
View Full Code Here

Examples of org.apache.commons.fileupload.servlet.ServletFileUpload.parseRequest()

  /** Constructor.  */
  public FileUploadWrapper(HttpServletRequest aRequest) throws IOException {
    super(aRequest);
    ServletFileUpload upload = new ServletFileUpload( new DiskFileItemFactory());
    try {
      List<FileItem> fileItems = upload.parseRequest(aRequest);
      convertToMaps(fileItems);
    }
    catch(FileUploadException ex){
      throw new IOException("Cannot parse underlying request: " + ex.toString());
    }
View Full Code Here

Examples of org.apache.commons.fileupload.servlet.ServletFileUpload.parseRequest()

  public void parseRequestParameters(Map<String, String> params,
      Map<String, com.bradmcevoy.http.FileItem> files) throws RequestParseException {
        try {
            if (isMultiPart()) {
                ServletFileUpload upload = new ServletFileUpload();
                List<FileItem> items = upload.parseRequest(request);
                parseQueryString(params);
                for (FileItem item : items) {
                    if (item.isFormField()) {
                        params.put(item.getFieldName(), item.getString());
                    } else {
View Full Code Here

Examples of org.apache.commons.fileupload.servlet.ServletFileUpload.parseRequest()

    FileItem imageFileFormField = null;
    try
    {
      FileItemFactory factory = new DiskFileItemFactory();
      ServletFileUpload upload = new ServletFileUpload(factory);
      List<?> items = upload.parseRequest(request);
      Iterator<?> iter = items.iterator();
      while(iter.hasNext())
      {
          item = (FileItem)iter.next();
          if(item.getFieldName().equals("file"))
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.