Interface IFileTransferProtocolToFactoryMapper


  • public interface IFileTransferProtocolToFactoryMapper
    Since:
    3.0.1
    • Method Detail

      • setRetrieveFileTransferFactory

        boolean setRetrieveFileTransferFactory​(String protocol,
                                               String id,
                                               IRetrieveFileTransferFactory factory,
                                               int priority)

        For the given protocol, set the given factory to be used for retrieve file transfer. If successful, subsequent retrieve requests for the given protocol will use the given factory.

        For this method to be successful the protocol has to be non-null, the id has to be non-null and unique (should probably be set to the bundle symbolic name of the bundle calling this method), the factory must be non-null, and the priority must be higher (a *smaller number*) than any existing factory for the given protocol. The default priority is 100, and the highest priority is 0.

        Parameters:
        protocol - the protocol (e.g. http/https) to map the factory to.
        id - a unique id for the factory (should be bundle symbolic name of bundle calling method)
        factory - the factory to associate with the given protocol
        priority - priority (highest = 0) to use for this factory relative to any existing factories.
        Returns:
        true if the given factory was set for this protocol, false if not
      • setRetrieveFileTransferFactory

        boolean setRetrieveFileTransferFactory​(String protocol,
                                               String id,
                                               IRetrieveFileTransferFactory factory,
                                               int priority,
                                               boolean uri)

        For the given protocol, set the given factory to be used for retrieve file transfer. If successful, subsequent retrieve requests for the given protocol will use the given factory.

        For this method to be successful the protocol has to be non-null, the id has to be non-null and unique (should probably be set to the bundle symbolic name of the bundle calling this method), the factory must be non-null, and the priority must be higher (a *smaller number*) than any existing factory for the given protocol. The default priority is 100, and the highest priority is 0.

        Parameters:
        protocol - the protocol (e.g. http/https) to map the factory to.
        id - a unique id for the factory (should be bundle symbolic name of bundle calling method)
        factory - the factory to associate with the given protocol
        priority - priority (highest = 0) to use for this factory relative to any existing factories.
        uri - if true the factory is added as a URI rather than a URL, meaning that no URLStreamHandler is registered for the given protocol. This is in contrast to the setRetrieveFileTransferFactory(String, String, IRetrieveFileTransferFactory, int), which automatically registers an URLStreamHandler for the given protocol. If false, URLs will be used and an URLStreamHandler will be registered for the given protocol factory. NOTE: If this flag is true, providers that attempt to access IFileID.getURL() may be unable to do so, since the URI may not be successfully parsed as a URL.
        Returns:
        true if the given factory was set for this protocol, false if not
      • getRetrieveFileTransferFactoryId

        String getRetrieveFileTransferFactoryId​(String protocol)
        Get the factory id of the active factory for the given protocol. If the given protocol does not have an active factory, returns null.
        Parameters:
        protocol - the protocol to get the id for (e.g. http/https)
        Returns:
        id of the factory associated with the given protocol
      • getRetrieveFileTransferPriority

        int getRetrieveFileTransferPriority​(String protocol)
        Get the priority of the active factory for the given protocol. If the given protocol does not have an active factory, returns -1.
        Parameters:
        protocol - the protocol to get the priority for (e.g. http/https)
        Returns:
        int priority for the given protocol
      • removeRetrieveFileTransferFactory

        boolean removeRetrieveFileTransferFactory​(String id)
        Remove the factory with the given id.
        Parameters:
        id - the id of the factory to remove.
        Returns:
        true if a factory was removed. false otherwise.
      • setBrowseFileTransferFactory

        boolean setBrowseFileTransferFactory​(String protocol,
                                             String id,
                                             IRemoteFileSystemBrowserFactory factory,
                                             int priority)

        For the given protocol, set the given factory to be used for retrieve file transfer. If successful, subsequent retrieve requests for the given protocol will use the given factory.

        For this method to be successful the protocol has to be non-null, the id has to be non-null and unique (should probably be set to the bundle symbolic name of the bundle calling this method), the factory must be non-null, and the priority must be higher (a *smaller number*) than any existing factory for the given protocol. The default priority is 100, and the highest priority is 0.

        Parameters:
        protocol - the protocol (e.g. http/https) to map the factory to.
        id - a unique id for the factory (should be bundle symbolic name of bundle calling method)
        factory - the factory to associate with the given protocol
        priority - priority (highest = 0) to use for this factory relative to any existing factories.
        Returns:
        true if the given factory was set for this protocol, false if not
      • setBrowseFileTransferFactory

        boolean setBrowseFileTransferFactory​(String protocol,
                                             String id,
                                             IRemoteFileSystemBrowserFactory factory,
                                             int priority,
                                             boolean uri)

        For the given protocol, set the given factory to be used for retrieve file transfer. If successful, subsequent retrieve requests for the given protocol will use the given factory.

        For this method to be successful the protocol has to be non-null, the id has to be non-null and unique (should probably be set to the bundle symbolic name of the bundle calling this method), the factory must be non-null, and the priority must be higher (a *smaller number*) than any existing factory for the given protocol. The default priority is 100, and the highest priority is 0.

        Parameters:
        protocol - the protocol (e.g. http/https) to map the factory to.
        id - a unique id for the factory (should be bundle symbolic name of bundle calling method)
        factory - the factory to associate with the given protocol
        priority - priority (highest = 0) to use for this factory relative to any existing factories.
        uri - if true the factory is added as a URI rather than a URL, meaning that no URLStreamHandler is registered for the given protocol. This is in contrast to the setRetrieveFileTransferFactory(String, String, IRetrieveFileTransferFactory, int), which automatically registers an URLStreamHandler for the given protocol. If false, URLs will be used and an URLStreamHandler will be registered for the given protocol factory. NOTE: If this flag is true, providers that attempt to access IFileID.getURL() may be unable to do so, since the URI may not be successfully parsed as a URL.
        Returns:
        true if the given factory was set for this protocol, false if not
      • getBrowseFileTransferFactoryId

        String getBrowseFileTransferFactoryId​(String protocol)
        Get the factory id of the active factory for the given protocol. If the given protocol does not have an active factory, returns null.
        Parameters:
        protocol - the protocol to get the id for (e.g. http/https)
        Returns:
        id of the factory associated with the given protocol
      • getBrowseFileTransferPriority

        int getBrowseFileTransferPriority​(String protocol)
        Get the priority of the active factory for the given protocol. If the given protocol does not have an active factory, returns -1.
        Parameters:
        protocol - the protocol to get the priority for (e.g. http/https)
        Returns:
        int priority for the given protocol
      • removeBrowseFileTransferFactory

        boolean removeBrowseFileTransferFactory​(String id)
        Remove the factory with the given id.
        Parameters:
        id - the id of the factory to remove.
        Returns:
        true if a factory was removed. false otherwise.
      • setSendFileTransferFactory

        boolean setSendFileTransferFactory​(String protocol,
                                           String id,
                                           ISendFileTransferFactory factory,
                                           int priority)

        For the given protocol, set the given factory to be used for retrieve file transfer. If successful, subsequent retrieve requests for the given protocol will use the given factory.

        For this method to be successful the protocol has to be non-null, the id has to be non-null and unique (should probably be set to the bundle symbolic name of the bundle calling this method), the factory must be non-null, and the priority must be higher (a *smaller number*) than any existing factory for the given protocol. The default priority is 100, and the highest priority is 0.

        Parameters:
        protocol - the protocol (e.g. http/https) to map the factory to.
        id - a unique id for the factory (should be bundle symbolic name of bundle calling method)
        factory - the factory to associate with the given protocol
        priority - priority (highest = 0) to use for this factory relative to any existing factories.
        Returns:
        true if the given factory was set for this protocol, false if not
      • setSendFileTransferFactory

        boolean setSendFileTransferFactory​(String protocol,
                                           String id,
                                           ISendFileTransferFactory factory,
                                           int priority,
                                           boolean uri)

        For the given protocol, set the given factory to be used for retrieve file transfer. If successful, subsequent retrieve requests for the given protocol will use the given factory.

        For this method to be successful the protocol has to be non-null, the id has to be non-null and unique (should probably be set to the bundle symbolic name of the bundle calling this method), the factory must be non-null, and the priority must be higher (a *smaller number*) than any existing factory for the given protocol. The default priority is 100, and the highest priority is 0.

        Parameters:
        protocol - the protocol (e.g. http/https) to map the factory to.
        id - a unique id for the factory (should be bundle symbolic name of bundle calling method)
        factory - the factory to associate with the given protocol
        priority - priority (highest = 0) to use for this factory relative to any existing factories.
        uri - if true the factory is added as a URI rather than a URL, meaning that no URLStreamHandler is registered for the given protocol. This is in contrast to the setRetrieveFileTransferFactory(String, String, IRetrieveFileTransferFactory, int), which automatically registers an URLStreamHandler for the given protocol. If false, URLs will be used and an URLStreamHandler will be registered for the given protocol factory. NOTE: If this flag is true, providers that attempt to access IFileID.getURL() may be unable to do so, since the URI may not be successfully parsed as a URL.
        Returns:
        true if the given factory was set for this protocol, false if not
      • getSendFileTransferFactoryId

        String getSendFileTransferFactoryId​(String protocol)
        Get the factory id of the active factory for the given protocol. If the given protocol does not have an active factory, returns null.
        Parameters:
        protocol - the protocol to get the id for (e.g. http/https)
        Returns:
        id of the factory associated with the given protocol
      • getSendFileTransferPriority

        int getSendFileTransferPriority​(String protocol)
        Get the priority of the active factory for the given protocol. If the given protocol does not have an active factory, returns -1.
        Parameters:
        protocol - the protocol to get the priority for (e.g. http/https)
        Returns:
        int priority for the given protocol
      • removeSendFileTransferFactory

        boolean removeSendFileTransferFactory​(String id)
        Remove the factory with the given id.
        Parameters:
        id - the id of the factory to remove.
        Returns:
        true if a factory was removed. false otherwise.
      • reinitialize

        boolean reinitialize()
        Reinitialized protocol to factory mapping defined via extension registry/extension points.
        Returns:
        true if reinitialization succeeds, false if not