use of org.eclipse.cdt.utils.pty.PTY in project linuxtools by eclipse.
the class AbstractDataManipulator method performCommand.
public void performCommand(String[] cmd, String file) {
Process proc = null;
IRemoteFileProxy fileProxy;
try {
try {
fileProxy = RemoteProxyManager.getInstance().getFileProxy(project);
} catch (RemoteConnectionException e) {
MessageDialog.openError(Display.getCurrent().getActiveShell(), Messages.MsgProxyError, Messages.MsgProxyError);
return;
}
IFileStore workDirStore = getWorkingDirStore();
proc = RuntimeProcessFactory.getFactory().exec(cmd, null, workDirStore, project, new PTY());
// $NON-NLS-1$
DebugPlugin.newProcess(launch, proc, "");
proc.waitFor();
StringBuffer data = new StringBuffer();
try (BufferedReader buffData = new BufferedReader(new InputStreamReader(fileProxy.getResource(file).openInputStream(EFS.NONE, null)))) {
readStream(buffData, data);
joinAll();
}
text = data.toString();
} catch (IOException | CoreException e) {
// $NON-NLS-1$
text = "";
} catch (InterruptedException e) {
// $NON-NLS-1$
text = "";
}
}
Aggregations