Skip to main content


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 #583616] Wed, 28 July 2010 00:41 Go to next message
No real name is currently offline No real nameFriend
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 #583676 is a reply to message #583616] Mon, 30 August 2010 18:10 Go to previous message
David McKnight is currently offline David McKnightFriend
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,
>
Previous Topic:Eclipse hang up. Suspecting RSE...
Next Topic:CDT launch using RSE
Goto Forum:
  


Current Time: Fri Apr 19 20:15:14 GMT 2024

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

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

Back to the top