Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.meterware.httpunit
Class MimeEncodedMessageBody  view MimeEncodedMessageBody download MimeEncodedMessageBody.java

java.lang.Object
  extended bycom.meterware.httpunit.MessageBody
      extended bycom.meterware.httpunit.MimeEncodedMessageBody

class MimeEncodedMessageBody
extends MessageBody

A POST-method message body which is MIME-encoded. This is used when uploading files, and is selected when the enctype parameter of a form is set to "multi-part/form-data".


Nested Class Summary
(package private)  class MimeEncodedMessageBody.MimeEncoding
           
 
Field Summary
private static java.lang.String BOUNDARY
           
private static byte[] CRLF
           
 
Constructor Summary
MimeEncodedMessageBody(PostMethodWebRequest request)
           
 
Method Summary
private  java.lang.String encode(java.lang.String string)
           
(package private)  java.lang.String getContentType()
          Returns the content type of this message body.
(package private)  PostMethodWebRequest getPostRequest()
          Returns the request associated with this message body, cast to a POST request.
protected  MessageBodyWebRequest getRequest()
           
private  void writeLn(java.io.OutputStream os, java.lang.String value)
           
private  void writeLn(java.io.OutputStream os, java.lang.String value, java.lang.String encoding)
           
(package private)  void writeTo(java.io.OutputStream outputStream)
          Transmits the body of this request as a sequence of bytes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BOUNDARY

private static final java.lang.String BOUNDARY
See Also:
Constant Field Values

CRLF

private static final byte[] CRLF
Constructor Detail

MimeEncodedMessageBody

public MimeEncodedMessageBody(PostMethodWebRequest request)
Method Detail

getContentType

java.lang.String getContentType()
Returns the content type of this message body.

Specified by:
getContentType in class MessageBody

getPostRequest

PostMethodWebRequest getPostRequest()
Returns the request associated with this message body, cast to a POST request.


writeTo

void writeTo(java.io.OutputStream outputStream)
       throws java.io.IOException
Transmits the body of this request as a sequence of bytes.

Specified by:
writeTo in class MessageBody

encode

private java.lang.String encode(java.lang.String string)

writeLn

private void writeLn(java.io.OutputStream os,
                     java.lang.String value,
                     java.lang.String encoding)
              throws java.io.IOException

writeLn

private void writeLn(java.io.OutputStream os,
                     java.lang.String value)
              throws java.io.IOException

getRequest

protected MessageBodyWebRequest getRequest()