}
if (outputReaderThreadException[0] != null) {
if (outputReaderThreadException[0] instanceof RuntimeException) {
throw (RuntimeException) outputReaderThreadException[0];
} else {
throw new RuntimeIOException(format("Cannot execute command [%s] on [%s]", obfuscatedCmd, CifsWinRmConnection.this), outputReaderThreadException[0]);
}
}
return exitValue();
} catch (InterruptedException exc) {
throw new RuntimeIOException(format("Cannot execute command [%s] on [%s]", obfuscatedCmd, CifsWinRmConnection.this), exc);
}
}
@Override
public synchronized void destroy() {
if (processTerminated) {
return;
}
winRmClient.signal();
winRmClient.deleteShell();
closeQuietly(callersStdin);
processTerminated = true;
}
@Override
public synchronized int exitValue() {
if (!processTerminated) {
throw new IllegalThreadStateException(format("Process for command [%s] on [%s] is still running", obfuscatedCmd,
CifsWinRmConnection.this));
}
return winRmClient.exitValue();
}
};
} catch (IOException exc) {
throw new RuntimeIOException("Cannot execute command " + cmd + " on " + this, exc);
}
}