org.apache.ace.gateway.log.task
Class Connection

java.lang.Object
  extended by org.apache.ace.gateway.log.task.Connection

public class Connection
extends Object

Helper class that abstracts handling of a URLConnection somewhat.


Constructor Summary
Connection(URL url)
           
 
Method Summary
 void close()
          Should be called when a Connection is used to do a POST (write to it's outputstream) without reading it's inputstream (the response).
 InputStream getInputStream()
          Enables the retrieving of input using this connection and returns an inputstream to the connection.
 OutputStream getOutputStream()
          Enables the sending of output using this connection and returns an outputstream to the connection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Connection

public Connection(URL url)
           throws IOException
Throws:
IOException
Method Detail

getInputStream

public InputStream getInputStream()
                           throws IOException
Enables the retrieving of input using this connection and returns an inputstream to the connection.

Returns:
Inputstream to the connection.
Throws:
IOException - If I/O problems occur.

getOutputStream

public OutputStream getOutputStream()
                             throws IOException
Enables the sending of output using this connection and returns an outputstream to the connection.

Returns:
Outputstream to the connection.
Throws:
IOException - If I/O problems occur.

close

public void close()
Should be called when a Connection is used to do a POST (write to it's outputstream) without reading it's inputstream (the response). Calling this will make sure the POST request is sent. If no data was written to the connection nothing is done.



Copyright © 2009-2011 The Apache Software Foundation. All Rights Reserved.