Search in sources :

Example 1 with StringOutputStream

use of org.eclipse.linuxtools.internal.systemtap.ui.ide.StringOutputStream in project linuxtools by eclipse.

the class TapsetParser method runRemoteStapAttempt.

private String runRemoteStapAttempt(String[] args, boolean getErrors) throws JSchException {
    StringOutputStream str = new StringOutputStream();
    StringOutputStream strErr = new StringOutputStream();
    IPreferenceStore p = ConsoleLogPlugin.getDefault().getPreferenceStore();
    String user = p.getString(ConsoleLogPreferenceConstants.SCP_USER);
    String host = p.getString(ConsoleLogPreferenceConstants.HOST_NAME);
    String password = p.getString(ConsoleLogPreferenceConstants.SCP_PASSWORD);
    int port = p.getInt(ConsoleLogPreferenceConstants.PORT_NUMBER);
    Channel channel = LinuxtoolsProcessFactory.execRemoteAndWait(args, str, strErr, user, host, password, port, EnvironmentVariablesPreferencePage.getEnvironmentVariables());
    if (channel == null) {
        return null;
    }
    channel.getSession().disconnect();
    channel.disconnect();
    return (!getErrors ? str : strErr).toString();
}
Also used : StringOutputStream(org.eclipse.linuxtools.internal.systemtap.ui.ide.StringOutputStream) Channel(com.jcraft.jsch.Channel) IPreferenceStore(org.eclipse.jface.preference.IPreferenceStore)

Aggregations

Channel (com.jcraft.jsch.Channel)1 IPreferenceStore (org.eclipse.jface.preference.IPreferenceStore)1 StringOutputStream (org.eclipse.linuxtools.internal.systemtap.ui.ide.StringOutputStream)1