}
void copyToTempFile(OverthereFile tempFile) {
logger.debug("Copying actual file {} to temporary file {} before download", this, tempFile);
CmdLine cpCmdLine = CmdLine.build(NOCD_PSEUDO_COMMAND)
.addTemplatedFragment(((SshElevatedUserConnection) connection).copyToTempFileCommand, this.getPath(), tempFile.getPath());
CapturingOverthereExecutionOutputHandler cpCapturedOutput = capturingHandler();
int cpResult = getConnection().execute(multiHandler(loggingOutputHandler(logger), cpCapturedOutput), multiHandler(loggingErrorHandler(logger), cpCapturedOutput), cpCmdLine);
if (cpResult != 0) {
String errorMessage = cpCapturedOutput.getOutput();
throw new RuntimeIOException("Cannot copy actual file " + this + " to temporary file " + tempFile + " before download: " + errorMessage);
}
CmdLine chmodCmdLine = CmdLine.build(NOCD_PSEUDO_COMMAND)
.addTemplatedFragment(((SshElevatedUserConnection) connection).overrideUmaskCommand, tempFile.getPath());
CapturingOverthereExecutionOutputHandler chmodCapturedOutput = capturingHandler();
int chmodResult = getConnection().execute(multiHandler(loggingOutputHandler(logger), chmodCapturedOutput), multiHandler(loggingErrorHandler(logger), chmodCapturedOutput), chmodCmdLine);
if (chmodResult != 0) {