Other considerations (Perhaps my analysis is rude, but I did my best to give elements of investigation..)
Now using the HttpUtil2Service of the LargeFileDownload. So the hc_ResponseSuccess is without comments, like the following:
Sub hc_ResponseSuccess (Response AsHttpResponse, TaskId AsInt)
' ********** Modified code *************
Dim cs AsCountingOutputStream
cs.Initialize(File.OpenOutput(TempFolder, TaskId, False))
Dim j As HttpJob = TaskIdToJob.Get(TaskId)
Dim jt As JobTag = j.Tag '##
jt.CountingStream = cs '<<< here Log displays "java.lang.RuntimeException: Field: CountingStream not found in: java.lang.Object"
jt.Total = Response.ContentLength
If jt.Data.url = ""Then
Log("Job cancelled before downloaded started")
cs.Close
EndIf
Response.GetAsynchronously("response", cs , True, TaskId)
'**************************************
'Response.GetAsynchronously("response", File.OpenOutput(TempFolder, TaskId, False), True, TaskId)
End Sub
But, for what I see, CountingStream is declared in JobTag in Process Globals of DownloadService:
TypeJobTag (Data AsDownloadData, CountingStream AsCountingOutputStream, Total AsLong)
So the error sounds strange to me. Further investigation indicates that the assignment: jt=j.Tab (marked ## above) is reponsible for the problem. As a matter of fact, if again I comment out the assignment, program doesn't crash in the previous line, but, obviously, elsewhere, missing evidently the information given by the assignment..
Thanks for your attention.