Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » DSDP - Target Management » Possible to use SystemRemoteFileDialog/SystemRemoteFolderDialog without RSE open
Possible to use SystemRemoteFileDialog/SystemRemoteFolderDialog without RSE open [message #575355] Wed, 18 June 2008 19:32 Go to next message
Eclipse UserFriend
Originally posted by: zengland.us.ibm.com

Is it possible to make use of the
SystemRemoteFileDialog/SystemRemoteFolderDialog classes without being in
or possibly even activating the Remote systems view or Remote Systems
Explorer perspective?

I have another perspective and view from which I need to browse a remote
system for which I already have the host name/address and a
userid/password.

I started out trying some code like below but ran into a number of issues
with the bundle not being loaded and values not being initialized.


new RSECorePlugin();
IRSESystemType[] systemTypes =
RSECorePlugin.getTheCoreRegistry().getSystemTypes();
if(systemTypes != null)
{
System.out.println(systemTypes);
}

Host host = null;
SystemProfile prof = null;
prof = new SystemProfile(hostAddress, true);
host = new Host(prof);

IRSESystemType type =
RSECoreRegistry.getInstance().getSystemTypeById(IRSESystemTy pe.SYSTEMTYPE_SSH_ONLY_ID);
ISubSystemConfigurator sub[] = null;
SystemRegistry reg = SystemRegistry.getInstance();
try {
reg.createHost("builtIn", type , hostName, hostName, id, remoteHost, 0,
sub );
} catch (Exception e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
diag = new SystemRemoteFileDialog(l_Form.getShell(), "browse remote file
system", host);
diag.open();
Object o = diag.getSelectedObject();


Is this type of usage even possible?
Re: Possible to use SystemRemoteFileDialog/SystemRemoteFolderDialog without RSE open [message #683954 is a reply to message #575355] Tue, 14 June 2011 18:27 Go to previous messageGo to next message
Samuel Lampa is currently offline Samuel LampaFriend
Messages: 9
Registered: June 2011
Junior Member
Indeed, I successfully do:

SystemRemoteFileDialog dialog = new SystemRemoteFileDialog(SystemBasePlugin.getActiveWorkbenchShell());
dialog.open();
				
Object o = dialog.getSelectedObject();
System.out.println("Selected object: " + o.toString());


Thanks for you post though ... it helped me figure out I had to do a ".open()" Smile

// Samuel

[Updated on: Tue, 14 June 2011 18:28]

Report message to a moderator

Re: Possible to use SystemRemoteFileDialog/SystemRemoteFolderDialog without RSE open [message #683967 is a reply to message #683954] Tue, 14 June 2011 19:05 Go to previous message
Samuel Lampa is currently offline Samuel LampaFriend
Messages: 9
Registered: June 2011
Junior Member
Or even better, change the two last lines to use "IRemoteFile", and you will have the proper convenience methods, such as for getting the path, etc:
IRemoteFile file = (IRemoteFile) dialog.getSelectedObject();
System.out.println("Selected file's abs path: " + file.getAbsolutePath());

[Updated on: Tue, 14 June 2011 19:06]

Report message to a moderator

Previous Topic:Adding sudo command
Next Topic:RSE: ftp quit after each transfer
Goto Forum:
  


Current Time: Fri Mar 29 11:24:09 GMT 2024

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

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

Back to the top