You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 11, 2024. It is now read-only.
this line of code will close the InputStream of reponse entity instantly, which cause the InputStream returned throw Exception when read.
So you simply cannot read a file if reponse body is larger than fileStreamCacheSize!
It won't work if you just delete this line of code. The connection is closed in the finally clause. So the InputStream returned by FileTemplate.getFileStream will always be closed when you try to read it.
The fix is to determine whether the reponse is cacheable(smaller than fileStreamCacheSize), if is not, read the response body into memory and return a InputStream point to the memory.