Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » DSDP - Target Management » Acess Restriction on rse.subsystems.files.ssh.SftpFileSubSystemConfiguration
Acess Restriction on rse.subsystems.files.ssh.SftpFileSubSystemConfiguration [message #549796] Wed, 28 July 2010 00:41 Go to next message
No real name is currently offline No real name
Messages: 5
Registered: July 2010
Junior Member
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,
Re: Acess Restriction on rse.subsystems.files.ssh.SftpFileSubSystemConfiguration [message #556085 is a reply to message #549796] Mon, 30 August 2010 18:10 Go to previous messageGo to next message
David McKnight is currently offline 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,
>
Re: Acess Restriction on rse.subsystems.files.ssh.SftpFileSubSystemConfiguration [message #557008 is a reply to message #556085] Fri, 03 September 2010 15:35 Go to previous messageGo to next message
No real name is currently offline No real name
Messages: 5
Registered: July 2010
Junior Member
It does.

Thanks!
Re: Acess Restriction on rse.subsystems.files.ssh.SftpFileSubSystemConfiguration [message #583743 is a reply to message #556085] Fri, 03 September 2010 15:35 Go to previous message
No real name is currently offline No real name
Messages: 5
Registered: July 2010
Junior Member
It does.

Thanks!
Previous Topic:How to export the RSE as an eclipse RCP production?
Next Topic:Execute command or script after SSH connection
Goto Forum:
  


Current Time: Wed Oct 22 05:08:59 GMT 2014

Powered by FUDForum. Page generated in 0.21485 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software