Java Reference
In-Depth Information
{
return Long.toString(random.nextLong(), 36);
}
/*
* The boundary used for a multipart post. This field is
* null if this is not a multipart form and has a value if
* this is a multipart form.
*/
private String boundary;
/*
* The stream to output the encoded form to.
*/
private OutputStream os;
/*
* Keep track of if we're on the first form element.
*/
private boolean first;
/**
* Prepare to access either a regular, or multipart, form.
*
* @param os
* The stream to output to.
* @param boundary
* The boundary to be used, or null if this is
* not a multipart form.
*/
public FormUtility(OutputStream os, String boundary)
{
this.os = os;
this.boundary = boundary;
}
/**
* Add a file to a multipart form.
*
* @param name
* The field name.
* @param file
* The file to attach.
* @throws IOException
* If any error occurs while writing.
*/
Search WWH ::




Custom Search