Package org.simpleframework.http.message

Examples of org.simpleframework.http.message.PartConsumer


   "... contents of file1.txt ...\r\n"+
   "--AaB03x\r\n";
  
   public void testHeader() throws Exception {
      PartData list = new PartData();
      PartConsumer consumer = new PartConsumer(new ArrayAllocator(), list, "AaB03x".getBytes("UTF-8"), 8192);
      Cursor cursor = new StreamCursor(SOURCE);
     
      while(!consumer.isFinished()) {
         consumer.consume(cursor);
      }  
      assertEquals(list.getParts().size(), 1);
      assertEquals(list.getParts().get(0).getContentType().getPrimary(), "text");
      assertEquals(list.getParts().get(0).getContentType().getSecondary(), "plain");
      assertEquals(((Part)list.getParts().get(0)).getHeader("Content-Disposition"), "form-data; name='pics'; filename='file1.txt'");        
View Full Code Here

TOP

Related Classes of org.simpleframework.http.message.PartConsumer

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.