net.sf.hermesftp.cmd
Interface SocketProvider

All Known Implementing Classes:
ActiveModeSocketProvider, PassiveModeSocketProvider

public interface SocketProvider

Interface implemented by classes that provide for the data channel in passive or active transfer mode.

Author:
Behnke

Method Summary
 void closeSocket()
          Closes the socket, if necessary.
 DataChannelInfo init()
          Initializes the provider.
 java.net.Socket provideSocket()
          Provides the socket for data transfer.
 

Method Detail

init

DataChannelInfo init()
                     throws java.io.IOException
Initializes the provider.

Returns:
Information about the data channel is provided.
Throws:
java.io.IOException - Error on initializing the data channel.

provideSocket

java.net.Socket provideSocket()
                              throws java.io.IOException
Provides the socket for data transfer. Multiple calls of this method do not result in multiple socket instance. One instance is created and cached.

Returns:
The Socket.
Throws:
java.io.IOException - Error on creating the data channel.

closeSocket

void closeSocket()
Closes the socket, if necessary.



Copyright © 2005-2007 Lars Behnke. All Rights Reserved.