use of org.eclipse.ecf.filetransfer.IRemoteFileSystemListener in project ecf by eclipse.
the class HttpClientBrowseFileTransferFactory method newInstance.
public IRemoteFileSystemBrowser newInstance() {
return new IRemoteFileSystemBrowser() {
private Proxy proxy;
private IConnectContext connectContext;
public Namespace getBrowseNamespace() {
return IDFactory.getDefault().getNamespaceByName(FileTransferNamespace.PROTOCOL);
}
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) {
// $NON-NLS-1$
throw new RemoteFileSystemException(NLS.bind("Exception creating URL for {0}", directoryOrFileId));
}
HttpClientFileSystemBrowser browser = new HttpClientFileSystemBrowser(new SNIAwareHttpClient(), directoryOrFileId, listener, url, connectContext, proxy);
return browser.sendBrowseRequest();
}
public void setConnectContextForAuthentication(IConnectContext connectContext) {
this.connectContext = connectContext;
}
public void setProxy(Proxy proxy) {
this.proxy = proxy;
}
public Object getAdapter(Class adapter) {
return null;
}
};
}
Aggregations