Skip to content

Commit

Permalink
before attempting to write into RESULT_FILE make sure its parent fold…
Browse files Browse the repository at this point in the history
…er exist
  • Loading branch information
neowit committed Jan 17, 2017
1 parent 827bcb0 commit 5f8f486
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ import com.neowit.response.LoginOauthResult

class LoginOauth(writer: ResponseWriterVim) extends VimProtocol[LoginOauthResult] {
def send(result: LoginOauthResult): Unit = {
result.resultFileOpt.foreach(f => writer.send("RESULT_FILE=" + f.getAbsolutePath))

result.resultFileOpt.foreach{f =>
// make sure all path folders exist
f.getParentFile.mkdirs()
writer.send("RESULT_FILE=" + f.getAbsolutePath)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ class SoqlQuery(writer: ResponseWriterVim) extends VimProtocol[SoqlQueryResult]
writer.send("RESULT_SIZE=" + size)
writer.send(InfoMessage("Record Count: " + size))
}
report.resultFileOpt.foreach(file => writer.send("RESULT_FILE=" + file.getAbsolutePath))
report.resultFileOpt.foreach{file =>
// make sure all path folders exist
file.getParentFile.mkdirs()
writer.send("RESULT_FILE=" + file.getAbsolutePath)
}
report.errors.foreach(writer.send(_))
}
}

0 comments on commit 5f8f486

Please sign in to comment.