|
Re: Acess Restriction on rse.subsystems.files.ssh.SftpFileSubSystemConfiguration [message #583676 is a reply to message #583616] |
Mon, 30 August 2010 18:10 |
David McKnight Messages: 244 Registered: July 2009 |
Senior Member |
|
|
Hi,
If you want to strictly use SSH, I would suggest creating an SSH Only
connection rather than a Unix Connection:
IRSESystemType systemType =
RSECorePlugin.getTheCoreRegistry().getSystemTypeById(IRSESys
temType.SYSTEMTYPE_SSH_ONLY_ID);
Once you've created the Host, you shouldn't need to instantiate the
FileSubsystem yourself; rather you should do something like this:
IRemoteFileSubSystem ss = RemoteFileUtility.getFileSubSystem(host);
In this case, the subsystem is an RSE-aware wrapper to the lower-level file
service.
Hope that helps!
<mlists@bigrideau.com> wrote in message
news:i2nucl$hcf$1@build.eclipse.org...
> Hi,
>
> I'm trying to use RSE to programmatically create a SFTP connection over
> SSH to view files on a remote server in a RCP application (Eclipse 3.5.1).
> Here is the code::
>
> ----
> IHost host = registry.getHost(profile, hostName);
>
> IRSESystemType systemType =
> RSECorePlugin.getTheCoreRegistry().getSystemTypeById(IRSESys
> temType.SYSTEMTYPE_UNIX_ID);
>
> host = registry.createHost(systemType, hostName, hostName, "Remote
> Connection");
>
> SftpFileSubSystemConfiguration sftpFileSubSystemConfiguration = new
> SftpFileSubSystemConfiguration();
>
> sftpFileSubSystemConfiguration.getSearchService(host);
>
> ISubSystemConfigurationProxy[] proxies =
> RSECorePlugin.getDefault().getSubSystemConfigurationProxies( );
>
> sftpFileSubSystemConfiguration.setSubSystemConfigurationProx
> y(proxies[4]); // Acess restriction error here
>
> FileServiceSubSystem fileService =
> (FileServiceSubSystem)registry.getSubSystems(host)[0];
> fileService.switchServiceFactory(sftpFileSubSystemConfigurat ion);
> ----
>
> Is this a valid approach? I am getting a few errors when trying to run it
> with the RSE-runtime-3.2 jars; before I had checked out all the RSE
> feature projects from CVS into my Eclipse workspace (and that worked
> fine).
>
> I can instantiate the SftpFileSubSystemConfiguration class from
> org.eclipse.rse.subsystems.files.ssh.SftpFileSubSystemConfig uration and
> use some of its methods such as getSearchService(host), however if I try
> setSubSystemConfigurationProxy(proxy) I get the following error:
>
> "Access restriction: The method
> setSubSystemConfigurationProxy(ISubSystemConfigurationProxy) from the type
> SubSystemConfiguration is not accessible due to restriction on required
> library ...\eclipse\plugins\org.eclipse.rse.ui_3.1.100.v201005282245 .jar
> "
>
> If you could point me in the right direction, it would be greatly
> appreciated.
>
> Thanks,
>
|
|
|
Powered by
FUDForum. Page generated in 0.02657 seconds