|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.encog.util.http.FormUtility
public class FormUtility
This class is used to construct responses to HTML forms. The class supports both standard HTML forms, as well as multipart forms.
Field Summary | |
---|---|
static int |
BUFFER_SIZE
The size of the read buffer. |
static String |
ENCODE
The charset to use for URL encoding. |
static int |
RANDOM_LENGTH
The length of random string to create for multipart. |
Constructor Summary | |
---|---|
FormUtility(OutputStream os,
String boundary)
Prepare to access either a regular, or multipart, form. |
Method Summary | |
---|---|
void |
add(String name,
File file)
Add a file to a multipart form. |
void |
add(String name,
String value)
Add a regular text field to either a regular or multipart form. |
void |
complete()
Complete the building of the form. |
static String |
getBoundary()
Generate a boundary for a multipart form. |
static Map<String,String> |
parse(String form)
Parse a URL query string. |
protected static String |
randomString()
Generate a random string, of a specified length. |
protected void |
writeln(String str)
Write a string, with a carriage return and linefeed. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String ENCODE
public static final int BUFFER_SIZE
public static final int RANDOM_LENGTH
Constructor Detail |
---|
public FormUtility(OutputStream os, String boundary)
os
- The stream to output to.boundary
- The boundary to be used, or null if this is not a multipart
form.Method Detail |
---|
public static String getBoundary()
public static Map<String,String> parse(String form)
form
- The query string to parse.
protected static String randomString()
public void add(String name, File file)
name
- The field name.file
- The file to attach.public void add(String name, String value)
name
- The name of the field.value
- The value of the field.public void complete()
protected void writeln(String str)
str
- The string to write.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |