Search in sources :

Example 1 with IRemoteFileSystemBrowserContainerAdapter

use of org.eclipse.ecf.filetransfer.IRemoteFileSystemBrowserContainerAdapter in project ecf by eclipse.

the class MultiProtocolFileSystemBrowserAdapter method sendBrowseRequest.

/* (non-Javadoc)
	 * @see org.eclipse.ecf.filetransfer.IRemoteFileSystemBrowserContainerAdapter#sendDirectoryRequest(org.eclipse.ecf.filetransfer.identity.IFileID, org.eclipse.ecf.filetransfer.IRemoteFileSystemListener)
	 */
public IRemoteFileSystemRequest sendBrowseRequest(IFileID directoryOrFileID, IRemoteFileSystemListener listener) throws RemoteFileSystemException {
    Assert.isNotNull(directoryOrFileID);
    Assert.isNotNull(listener);
    URL url;
    try {
        url = directoryOrFileID.getURL();
    } catch (final MalformedURLException e) {
        throw new RemoteFileSystemException(Messages.AbstractRetrieveFileTransfer_MalformedURLException);
    }
    IRemoteFileSystemBrowserContainerAdapter fileSystemBrowser = null;
    fileSystemBrowser = Activator.getDefault().getBrowseFileTransfer(url.getProtocol());
    if (fileSystemBrowser == null) {
        if (url.getProtocol().equalsIgnoreCase("file")) {
            // $NON-NLS-1$
            LocalFileSystemBrowser fsb = new LocalFileSystemBrowser(directoryOrFileID, listener);
            return fsb.sendBrowseRequest();
        }
        URLFileSystemBrowser ufsb = new URLFileSystemBrowser(directoryOrFileID, listener, url, connectContext, proxy);
        return ufsb.sendBrowseRequest();
    }
    // Set connect context
    fileSystemBrowser.setConnectContextForAuthentication(connectContext);
    // Set Proxy
    fileSystemBrowser.setProxy(proxy);
    return fileSystemBrowser.sendBrowseRequest(directoryOrFileID, listener);
}
Also used : RemoteFileSystemException(org.eclipse.ecf.filetransfer.RemoteFileSystemException) IRemoteFileSystemBrowserContainerAdapter(org.eclipse.ecf.filetransfer.IRemoteFileSystemBrowserContainerAdapter) MalformedURLException(java.net.MalformedURLException) URL(java.net.URL)

Aggregations

MalformedURLException (java.net.MalformedURLException)1 URL (java.net.URL)1 IRemoteFileSystemBrowserContainerAdapter (org.eclipse.ecf.filetransfer.IRemoteFileSystemBrowserContainerAdapter)1 RemoteFileSystemException (org.eclipse.ecf.filetransfer.RemoteFileSystemException)1