issrg.utils.webdav
Class WebDAVSocketHTTPS

java.lang.Object
  extended by issrg.utils.webdav.WebDAVSocketHTTPS
All Implemented Interfaces:
WebDAVSocket

public class WebDAVSocketHTTPS
extends java.lang.Object
implements WebDAVSocket

This class is the implementation of a Socket for use over a HTTPS connection. It's methods are defined in the WebDAVSocket interface.

Version:
19/03/2007
Author:
Sean Antony

Constructor Summary
WebDAVSocketHTTPS(java.lang.String p12filename, java.lang.String p12passphrase)
          A non-empty constructor is required for HTTPS because we need the user to provide the location of the PKCS12 file to be used for authentication, and the password required to open it.
 
Method Summary
 void close()
          3.
 void open(java.lang.String host, int port)
          1.
 byte[] sendAndReceive(byte[] message)
          2.
 java.lang.String sendAndReceive(java.lang.String message)
          2.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebDAVSocketHTTPS

public WebDAVSocketHTTPS(java.lang.String p12filename,
                         java.lang.String p12passphrase)
                  throws HTTPMessageException
A non-empty constructor is required for HTTPS because we need the user to provide the location of the PKCS12 file to be used for authentication, and the password required to open it.

Parameters:
p12filename - filename for the PKCS12 file containing the user's certificate and key for SSL authentication.
p12passphrase - the password of the PKCS12 file.
Throws:
HTTPMessageException - on SSL error
Method Detail

open

public void open(java.lang.String host,
                 int port)
          throws java.io.IOException
Description copied from interface: WebDAVSocket
1. A HTTP client opens a connection.

Specified by:
open in interface WebDAVSocket
Throws:
java.io.IOException

sendAndReceive

public java.lang.String sendAndReceive(java.lang.String message)
                                throws java.io.IOException
Description copied from interface: WebDAVSocket
2. Sends a request message to a HTTP server and the server returns a response message, containing the requested data or an error.

Specified by:
sendAndReceive in interface WebDAVSocket
Parameters:
message - client request message
Returns:
server response message
Throws:
java.io.IOException

sendAndReceive

public byte[] sendAndReceive(byte[] message)
                      throws java.io.IOException
Description copied from interface: WebDAVSocket
2. Sends a request message to a HTTP server and the server returns a response message, containing the requested data or an error.

Specified by:
sendAndReceive in interface WebDAVSocket
Parameters:
message - client request message in binary
Returns:
server response message in binary
Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException
Description copied from interface: WebDAVSocket
3. Closes the connection.

Specified by:
close in interface WebDAVSocket
Throws:
java.io.IOException