Remote System Explorer SFTP Setup for Eclipse

From wiki.emacinc.com
Jump to: navigation, search
TODO: {{#todo:SEOKWREV (11.15.13-17:21->KY+);(11.17.13-20:15->MD+);(03.04.14-16:50->BS-)|Michael Gloff|oe 4,mg,ky,md,bs,SEOKWREV}}

The Eclipse Remote System Explorer plugin provides SSH File Transfer Protocol (SFTP) capabilities to facilitate the transfer of files between the development machine and the target machine. This includes a GUI service which allows developers to "drag-and-drop" files between the development and remote file systems, and the ability for Eclipse to edit a file within a local editor and update the remote copy when saved.

Open the RSE Perspective

The RSE plugin provides the Eclipse workbench with a new perspective that facilitates the use of its services. To open this perspective:

  1. Select Window -> Open Perspective -> Other...
  2. In the Open Perspective dialog, select Remote System Explorer and click OK. This should result in a screen similar to that shown in Figure 1 below. To add a new connection, follow the instructions for doing so on the RSE Setup Guide.
Figure 1: RSE Perspective


Transferring Files

Once a remote connection has been established, it is possible to use the Remote System Explorer View, highlighted in Figure 2 below, to navigate the directories of the remote machine as well as the local machine. This view can also be used to graphically drag-and-drop files between machines.

Figure 2. Browsing a Remote Filesystem


The drag-and-drop feature of RSE's SFTP facility is no different than that on any other computer. The target file can actually be dragged from its source and dropped into its destination folder using drag-and-drop. Alternatively, the Remote Systems View context menu can be used to copy a file and then paste it into its destination.


Remote File Editing

RSE's SFTP offers the ability to edit a copy of a remote file then automatically upload the contents of that file when it is saved during the edit session. The Remote Systems View also provides the convenience of being able to create a new file on the remote system

Create a New File

To create a new file:

  1. Right-click on the directory in the Remote Systems Explorer View where the new file is to be located to bring up a context menu for that directory.

  2. Select New -> File or New -> Folder to create a new file or directory. This will cause the New File prompt to appear as shown in Figure 3 below.

    Figure 3. New File Dialog


  3. Enter the name of the new file in the New file name: field and click Finish to create the file.

This procedure creates a new file in the specified folder, but does not open it in an editor. The next step is to learn how to open the remote file in an editor, make changes, then save those changes on the remote machine.

Edit an Existing File

Once a file exists on the remote machine, RSE provides the ability to edit it on the development machine without having to manually transfer the files between machines.

Open a Remote File

To open a remote file in Eclipse on the development machine:

  1. Right-click on the file in the Remote Systems Explorer View to bring up the Remote Systems View context menu.
  2. Click Open. Alternatively, click Open with... to see a list of editors available for that type of file.

The file should open in the Eclipse editor and allow you to make changes.

Save a Remote File

Saving a file during a remote edit session is no different than doing the same during a local edit session. Simply click the Save button or use the File -> Save or File -> Save As... menus. The Ctrl+S keyboard shortcut may be used as well.

Next Steps

After editing and uploading a file on the remote machine, it can be manipulated using an SSH Shell or Terminal -- two additional services provided by the RSE plugin. See the RSE Shell and Terminal Setup page to learn more.