org.eclipse.ecf.fileshare
Interface IFileShareContainerAdapter


public interface IFileShareContainerAdapter

File share container entry point adapter. This interface is an adapter to allow providers to expose file sharing to clients. It may be used in the following way:

 IFileShareContainerAdapter filesharecontainer = (IFileShareContainerAdapter) container.getAdapter(IFileShareContainerAdapter.class);
 if (filesharecontainer != null) {
    // use filesharecontainer
    ...
 } else {
    // container does not support file share container functionality
 }
 


Method Summary
 IFileShare createRetriever(ID fileShareID, ID remoteSrc, java.io.File localTarget, IFileShareListener listener, java.util.Map properties)
          Create IFileShare instance for receiving a file
 IFileShare createRetriever(IFileShareRetrieveConfig config)
          Create IFileShare instance for receiving a file
 IFileShare createSender(ID fileShareID, java.io.InputStream inputForSend, ID remoteTarget, IFileShareListener listener, java.util.Map properties)
          Create IFileShare instance for sending a file
 IFileShare createSender(IFileShareSenderConfig config)
          Create IFileShare instance for sending a file
 Namespace getFileNamespace()
          Get Namespace for identifying remote files.
 IFileShare getFileShare(ID fileShareID)
          Get IFileShare instance from container
 Namespace getFileShareNamespace()
          Get Namespace for creating new IFileShare IDs.
 boolean removeFileShare(ID fileShareID)
          Remove IFileShare instance from container
 

Method Detail

getFileShareNamespace

Namespace getFileShareNamespace()
Get Namespace for creating new IFileShare IDs. The Namespace returned should be used to create IDs to use in the create methods on this interface.

Returns:
Namespace to be used for IDs for creating IFileShare instances

getFileNamespace

Namespace getFileNamespace()
Get Namespace for identifying remote files. The Namespace returned from this method can be used to create IDs that identify remote files. Such IDs can be used for the create methods in this interface (e.g. remoteTarget param in createSender)

Returns:
Namespace to be used for IDs for creating IFileShare instances

createSender

IFileShare createSender(ID fileShareID,
                        java.io.InputStream inputForSend,
                        ID remoteTarget,
                        IFileShareListener listener,
                        java.util.Map properties)
                        throws ECFException
Create IFileShare instance for sending a file

Parameters:
fileShareID - the ID for the new IFileShare instance. This ID must be created with the namespace returned from getFileShareNamespace(). Must not be null.
inputForSend - the InputStream representing access to the local file being sent. Must not be null.
remoteTarget - the ID specifying the file name on the remote system. This ID must be created with the namespace returned from getFileNamespace().
listener - the IFileShareListener to receive asynchronous notifications as the file sharing is performed
properties - a Map of properties associated with the IFileShare instance
Returns:
IFileShare the new IFileShare instance
Throws:
ECFException - if some problem with creating the IFileShare instance given input parameters

createSender

IFileShare createSender(IFileShareSenderConfig config)
                        throws ECFException
Create IFileShare instance for sending a file

Parameters:
config - IFileShareSenderConfig defining the configuration for the new IFileShare instance
Returns:
IFileShare the new IFileShare instance
Throws:
ECFException - if some problem with creating the IFileShare instance given input parameters

createRetriever

IFileShare createRetriever(ID fileShareID,
                           ID remoteSrc,
                           java.io.File localTarget,
                           IFileShareListener listener,
                           java.util.Map properties)
                           throws ECFException
Create IFileShare instance for receiving a file

Parameters:
fileShareID - the ID for the new IFileShare instance. This ID must be created with the namespace returned from getFileShareNamespace(). Must not be null.
remoteSrc - the ID specifying the file name on the remote system to retrieve. This ID must be created with the namespace returned from getFileNamespace().
localTarget - a target file/directory on local file system for storage of the retrieved file
listener - the IFileShareListener to receive asynchronous notifications as the file sharing is performed
properties - a Map of properties associated with the IFileShare instance
Returns:
IFileShare the new IFileShare instance
Throws:
ECFException - if some problem with creating the IFileShare instance given input parameters

createRetriever

IFileShare createRetriever(IFileShareRetrieveConfig config)
                           throws ECFException
Create IFileShare instance for receiving a file

Parameters:
config - IFileShareSenderConfig defining the configuration for the new IFileShare instance
Returns:
IFileShare the new IFileShare instance
Throws:
ECFException - if some problem with creating the IFileShare instance given input parameters

getFileShare

IFileShare getFileShare(ID fileShareID)
Get IFileShare instance from container

Parameters:
fileShareID - the ID of the IFileShare instance to retrieve
Returns:
IFileShare instance with given ID. Returns null if not found.

removeFileShare

boolean removeFileShare(ID fileShareID)
Remove IFileShare instance from container

Parameters:
fileShareID - the ID of the IFileShare instance to remove
Returns:
true if IFileShare removed. False if identified instance does not exist within this container