Package com.webobjects.appserver.WOMultipartIterator

Examples of com.webobjects.appserver.WOMultipartIterator.WOFormData


          }
        }
      } 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!");

        contentDispositionHeaders = nextFormData.contentDispositionHeaders();
        String aFileName = null;

        if(hasBinding(Bindings.filePath)) {
          aFileName = (String) contentDispositionHeaders.valueForKey(Headers.filename);
          setFilePath(aFileName);
        }

        if (hasBinding(Bindings.mimeType)) {
          setMimeType((String) contentDispositionHeaders.valueForKey(Headers.contentType));
        }

        InputStream anInputStream = nextFormData.formDataInputStream();
        if(aFileName != null && aFileName.length() > 0) {
          if(hasBinding(Bindings.inputStream)) {
            setValueForBinding(anInputStream, Bindings.inputStream);
          } else {
            String localFilePath = null;
View Full Code Here


          }
        }
      } 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!");

        contentDispositionHeaders = nextFormData.contentDispositionHeaders();
        String aFileName = null;

        if(hasBinding(Bindings.filePath)) {
          aFileName = (String) contentDispositionHeaders.valueForKey(Headers.filename);
          setFilePath(aFileName);
        }

        if (hasBinding(Bindings.mimeType)) {
          setMimeType((String) contentDispositionHeaders.valueForKey(Headers.contentType));
        }

        InputStream anInputStream = nextFormData.formDataInputStream();
        if(aFileName != null && aFileName.length() > 0) {
          if(hasBinding(Bindings.inputStream)) {
            setValueForBinding(anInputStream, Bindings.inputStream);
          } else {
            String localFilePath = null;
View Full Code Here

TOP

Related Classes of com.webobjects.appserver.WOMultipartIterator.WOFormData

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.