Package com.webobjects.appserver

Examples of com.webobjects.appserver.WOMultipartIterator


      long streamLength = -1L;

      try {
        String sessionIdKey = WOApplication.application().sessionIdKey();
        String sessionId = request.cookieValueForKey(sessionIdKey);
        WOMultipartIterator multipartIterator = request.multipartIterator();
        if (multipartIterator == null) {
          response.appendContentString("Already Consumed!");
        }
        else {
          WOMultipartIterator.WOFormData formData = null;
          while ((formData = multipartIterator.nextFormData()) != null) {
            String name = formData.name();
            if (sessionIdKey.equals(name)) {
              sessionId = formData.formValue();
            }
            else if ("id".equals(name)) {
              uploadIdentifier = formData.formValue();
            }
            else if (formData.isFileUpload()) {
              uploadFileName = request.stringFormValueForKey(name + ".filename");
              streamLength = multipartIterator.contentLengthRemaining();
              uploadInputStream = formData.formDataInputStream();
              break;
            }
          }
          context._setRequestSessionID(sessionId);
View Full Code Here


            setMimeType((String) request.formValueForKey(uploadName() + ".mimetype"));
          }
        }
      } else {
        // multipart data
        WOMultipartIterator multipartIterator = request.multipartIterator();
        WOFormData nextFormData = multipartIterator.nextFormData();
        NSDictionary<Object, String> contentDispositionHeaders;
        do {
          if (nextFormData == null)
            break;
          contentDispositionHeaders = nextFormData.contentDispositionHeaders();
          Object _name = contentDispositionHeaders.objectForKey(Headers.name);
          if (uploadName().equals(_name))
            break;
          nextFormData = multipartIterator.nextFormData();
        } while(true);

        if(nextFormData == null)
          throw new IllegalStateException("AjaxUploadButton: No form data left for WOFileUpload!");
View Full Code Here

            setMimeType((String) request.formValueForKey(uploadName() + ".mimetype"));
          }
        }
      } else {
        // multipart data
        WOMultipartIterator multipartIterator = request.multipartIterator();
        WOFormData nextFormData = multipartIterator.nextFormData();
        NSDictionary<Object, String> contentDispositionHeaders;
        do {
          if (nextFormData == null)
            break;
          contentDispositionHeaders = nextFormData.contentDispositionHeaders();
          Object _name = contentDispositionHeaders.objectForKey(Headers.name);
          if (uploadName().equals(_name))
            break;
          nextFormData = multipartIterator.nextFormData();
        } while(true);

        if(nextFormData == null)
          throw new IllegalStateException("AjaxUploadButton: No form data left for WOFileUpload!");
View Full Code Here

TOP

Related Classes of com.webobjects.appserver.WOMultipartIterator

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.