Package nexj.core.util

Examples of nexj.core.util.MIMEHeader$Value


                     {
                        tobj.setValue(BODY, null);
                     }
                     else
                     {
                        MIMEHeader header;

                        if (m_channel.getDataType() == Primitive.BINARY ||
                           m_channel.getDataType() == null && MIMEUtil.isBinaryMIMEType(
                              ((header = headerMap.find(HTTP.HEADER_CONTENT_TYPE)) == null) ? null : header.getValue()))
                        {
                           tobj.setValue(BODY, new StreamInput(istream, sEncoding).getBinary());
                        }
                        else
                        {
View Full Code Here


   {
      TransferObject headers = new TransferObject(headerMap.size());

      for (int i = 0, n = headerMap.size(); i < n; ++i)
      {
         MIMEHeader header = headerMap.get(i);
         String sName = header.getName().toLowerCase(Locale.ENGLISH);
         String sValue = header.getValue();
         Object value;

         switch (HTTP.getHeaderType(sName))
         {
            case HTTP.TYPE_INTEGER:
View Full Code Here

            sQuery = null;
            nDelimiterIndex = qryBuf.length();
         }

         StringBuilder bodyBuf = null;
         MIMEHeader contentTypeHdr = headerMap.find(HTTP.HEADER_CONTENT_TYPE);

         if (contentTypeHdr != null)
         {
            MIMEHeader.Value contentType = contentTypeHdr.getFirstValue();

            if (contentType != null && contentType.getName().equals(HTTP.ENCODING_FORM))
            {
               bodyBuf = new StringBuilder(128);
            }
View Full Code Here

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

         long lMaxSize = lDefMaxSize;
View Full Code Here

   protected Lookup getMultipartParameters(Lookup sizeMap, long lDefMaxSize) throws IOException, RequestException
   {
      try
      {
         Lookup paramMap = new HashTab();
         MIMEHeader header = new MIMEHeader(null, m_request.getHeader("Content-Type"));

         if (header.getFirstValue() == null || !header.getFirstValue().getName().equals(MULTIPART_FORM_DATA))
         {
            throw new MultipartDataException("Unexpected content type");
         }

         String sSeparator = header.getFirstValue().findArg("boundary");

         if (sSeparator == null || sSeparator.length() == 0)
         {
            throw new MultipartDataException("Missing multipart boundary in content-type");
         }
View Full Code Here

TOP

Related Classes of nexj.core.util.MIMEHeader$Value

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.