|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfix.HttpClient
public class HttpClient
Field Summary | |
---|---|
private boolean |
debug
|
private ErrorWindow |
er
|
private static boolean |
error
|
private long |
max
|
private java.lang.String |
NEWLINE
|
java.io.DataOutputStream |
out
|
private long |
reached
|
private java.lang.String |
response
|
private java.net.Socket |
socket
|
private static javax.net.ssl.SSLSocketFactory |
sslSocketFactory
|
Constructor Summary | |
---|---|
HttpClient(ErrorWindow e,
boolean d)
The standard constructor for this class. |
Method Summary | |
---|---|
void |
connect(java.lang.String host)
Establishes a connection to the given host URL by using httpConnect()
or httpsConnect() |
int |
getPort(java.lang.String protocol)
Gets the port number from the given protocol. |
java.net.Socket |
getSocket()
Gets the Socket for use in other classes |
javax.net.ssl.SSLSocketFactory |
getSocketFactory()
Returns a SSL Factory instance that accepts all server certificates. |
void |
httpConnect(java.lang.String host,
int port)
Establishes a HTTP-Connection using a Socket |
void |
httpsConnect(java.lang.String host,
int port)
Establishes a HTTPS-Connection using a Socket. |
void |
nl()
Sends a newline (\r\n) to the Server using the send method |
java.lang.String[] |
parseURL(java.lang.String address)
Parses the given URL address and returns an array existing of: [0]: Protocol (http, https) [1]: Host-Address [2]: the Host-Port as a String [3]: the Requested File. |
void |
send(byte[] HTTP)
Sends a HTTP-MIME-Message to the Server. |
void |
send(java.lang.String HTTP)
Sends a HTTP-MIME-Message to the Server. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.net.Socket socket
private java.lang.String NEWLINE
public java.io.DataOutputStream out
private java.lang.String response
private long max
private long reached
private ErrorWindow er
private static boolean error
private static javax.net.ssl.SSLSocketFactory sslSocketFactory
private boolean debug
Constructor Detail |
---|
public HttpClient(ErrorWindow e, boolean d)
e
- The instance of ErrorWindow the errors are displayed with.d
- The debug value, if true the debugging is enabled.Method Detail |
---|
public void connect(java.lang.String host)
httpConnect()
or httpsConnect()
host
- URL to connect topublic void httpConnect(java.lang.String host, int port)
host
- The hostname to connect topublic void httpsConnect(java.lang.String host, int port)
host
- The host name to connect topublic void send(java.lang.String HTTP)
HTTP
- the message to sendpublic void send(byte[] HTTP)
HTTP
- the message to sendpublic void nl()
public java.lang.String[] parseURL(java.lang.String address)
IllegalArgumentException
will be thrown
address
- the URL address to be parsed
public int getPort(java.lang.String protocol)
protocol
-
public java.net.Socket getSocket()
public final javax.net.ssl.SSLSocketFactory getSocketFactory()
SSLSocket sock = (SSLSocket) getSocketFactory.createSocket ( host, port );
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |