|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--kom.tools.ipc.IPCClient | +--kom.tools.web.HTTPClient
This is a subclass of IPCClient, used to communicate with other HTTP servers.
Field Summary | |
(package private) java.lang.String |
boundary
|
static java.lang.String |
CL
|
protected HTTPConfig |
config
Configuration instance |
protected IPCConnection |
connection
IP connection |
(package private) static java.lang.String |
fSeparator
|
(package private) static char |
sepChar
|
protected java.io.File |
tmpFile
|
Fields inherited from class kom.tools.ipc.IPCClient |
connection |
Constructor Summary | |
HTTPClient(java.lang.String host,
int port,
HTTPConfig config)
Class constructor |
Method Summary | |
void |
close()
Closes connection to remote host |
private int |
conn(boolean write,
java.lang.String arg)
Sends data over the wire to the remote host, or just counts bytes. |
private int |
handle(java.util.Hashtable data,
boolean write)
Converts data to lines according to protocol, counts characters and may send the data. |
private int |
handlefile(java.lang.String source,
java.lang.String filename,
boolean write)
Converts file contents to HTTP data and counts bytes, may send contents. |
void |
receive()
Receives data from remote host |
void |
send(java.util.Hashtable data)
Sends data to remote host |
private void |
sendFile(java.io.File in)
Sends contents of file over the wire |
java.io.File |
tempFile()
Defines tmpFile |
Methods inherited from class kom.tools.ipc.IPCClient |
connect |
Methods inherited from class java.lang.Object |
|
Field Detail |
protected HTTPConfig config
protected IPCConnection connection
protected java.io.File tmpFile
java.lang.String boundary
static java.lang.String fSeparator
static char sepChar
public static final java.lang.String CL
Constructor Detail |
public HTTPClient(java.lang.String host, int port, HTTPConfig config)
host
- Remote host addressport
- Port on remote hostconfig
- Configuration for this serverMethod Detail |
public java.io.File tempFile()
public void send(java.util.Hashtable data)
data
- Table of data to be sentprivate int handle(java.util.Hashtable data, boolean write)
data
- Table of datawrite
- true if data should be sent, not just countedprivate int handlefile(java.lang.String source, java.lang.String filename, boolean write)
source
- File path except for filenamefilename
- Last part of file pathwrite
- true if data should be sent, not just countedprivate void sendFile(java.io.File in)
in
- File to be sentprivate int conn(boolean write, java.lang.String arg)
write
- true if data should be sent,
otherwise the bytes are just countedarg
- String to be sentpublic void receive()
public void close()
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |