public class httpHelper extends Object
Some methods need to be added for escaping and unescaping character strings. For text that appears in web pages, this would include the handling of ampersands, less than, and greater than symbols
It may also be necessary to include something for the handling of material inside quoted strings. (both single and double quotes)
Modifier and Type | Field and Description |
---|---|
protected int |
debugLevel
Controls amount of diagnostic output.
|
Constructor and Description |
---|
httpHelper() |
Modifier and Type | Method and Description |
---|---|
int |
getDebugLevel()
Getter for debugLevel.
|
String |
readHttpPage(String host,
int port,
String fileName)
Copy the contents of a web page into a String object
|
void |
setDebugLevel(int value)
Setter for debugLevel.
|
protected int debugLevel
getDebugLevel()
,
setDebugLevel(int)
public httpHelper()
public int getDebugLevel()
debugLevel
public void setDebugLevel(int value)
value
- Value for debugLeveldebugLevel
public String readHttpPage(String host, int port, String fileName) throws IOException
It may be advantageous to have these routines able to
time out in the same way as the methods in
FileHelpers
.
The first thing to do would be to use the set timeout
methods for Socket.
host
- Domain name or IP address of web server (Domain name only.
e.g. www.cnn.com)port
- Port number for web serverfileName
- Directory and name for web page (No leading slash.
e.g. index.html)IOException
Socket