Package nexj.core.util

Examples of nexj.core.util.MultipartInputStream


      {
         return;
      }
     
      byte[] buf = null;
      MultipartInputStream multipartStream = new MultipartInputStream(requestInputStream, sSeparator.getBytes(sEncoding),
         sEncoding);
     
      while (multipartStream.nextPart())
      {
         MIMEHeader header = multipartStream.getHeaders().find("Content-Disposition");

         if (header == null)
         {
            continue;
         }

         MIMEHeader.Value value = header.getFirstValue();

         if (value == null || !value.getName().equals("form-data") && !value.getName().equals("attachment"))
         {
            continue;
         }

         String sName = value.findArg("name");

         if (sName == null)
         {
            continue;
         }

         String sFileName = getFilenameForUpload(header);
        
         header = multipartStream.getHeaders().find("Content-Type");

         if (header != null && header.getFirstValue() != null && header.getFirstValue().getName().startsWith("multipart/"))
         {
            throw new MultipartDataException("Multiple files per input are not supported");
         }
View Full Code Here

TOP

Related Classes of nexj.core.util.MultipartInputStream

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.