Commit ec9d37f9 authored by Adrien's avatar Adrien

try to change method signature

parent 696e2e8b
......@@ -39,27 +39,22 @@ class CodeSigningRestController {
var macCodeSign = MacCodeSign()
@PostMapping("/test")
fun signProduct(response: HttpServletResponse): StreamingResponseBody {
fun test(response: HttpServletResponse) {
val file : File = File("/Users/codesign/Downloads/BonitaStudioCommunity-7.8.9-SNAPSHOT-x86.exe")
val file : File = File("/Users/codesign/Downloads/BonitaStudioCommunity-7.8.0-SNAPSHOT-x86.exe")
response.setContentType("application/octet-stream")
response.setHeader("Content-Disposition", "attachment; filename='${file.name}'")
logger.info("returning file " + file.name +"...")
return StreamingResponseBody { outputStream ->
FileInputStream(file.canonicalFile).use { inputStream ->
try {
val bytesCopied: Int = IOUtils.copy(inputStream, outputStream)
val bytesCopied: Int = IOUtils.copy(inputStream, response.outputStream)
logger.info(bytesCopied.toString() + " have been copied")
} catch (e: Exception) {
logger.error("An error occured during stream copy", e)
} catch (e: RuntimeException) {
logger.error("An error occured during stream copy", e)
}
outputStream.flush()
outputStream.close()
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment