use of org.eclipse.linuxtools.systemtap.ui.consolelog.ScpClient in project linuxtools by eclipse.
the class RunScriptHandler method prepareNonLocalScript.
/**
* Attempts to set up a channel for a script that runs on a non-local host or user.
* @return <code>true</code> on success, <code>false</code> on failure.
* @throws ExecutionException If failure occurs during a (non-simple) launch,
* this will throw an exception instead of returning <code>false</code>.
*/
private void prepareNonLocalScript() throws ExecutionException {
try {
ScpClient scpclient = new ScpClient(remoteOptions);
// $NON-NLS-1$
tmpfileName = new Path("/tmp").append(getFileName(fileName)).toOSString();
scpclient.transfer(fileName, tmpfileName);
} catch (final JSchException | IOException e) {
String message = e instanceof JSchException ? // $NON-NLS-1$
Localization.getString("RunScriptHandler.checkCredentials") : // $NON-NLS-1$
Localization.getString("RunScriptHandler.ioError");
throw new ExecutionException(message, e);
}
}
Aggregations