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
But after doing the copy, it doesn't close the stream.
On further investigation, I found that LocalFileSystemStore was handling this by closing the stream inside its implementation of setResourceContent. This seems odd to me, because the stream is passed from the outside, which implies that the caller owns it, and thus the caller should surely be responsible for closing it.
Maybe this could be cleared up, either by flipping the responsibilities around to close it from the caller, or by clearly documenting on setResourceContent the contract that the implementation is expected to close the stream. (The caveat of the latter being that if there was an issue calling the method, the code which closes the stream might not be called, i.e., the only really safe place to have the closing code is at the caller.)
The text was updated successfully, but these errors were encountered:
I found that the
COPY
method wasn't closing file streams.The servlet calls this to get the source data:
Then it does the copy by passing it to:
But after doing the copy, it doesn't close the stream.
On further investigation, I found that
LocalFileSystemStore
was handling this by closing the stream inside its implementation ofsetResourceContent
. This seems odd to me, because the stream is passed from the outside, which implies that the caller owns it, and thus the caller should surely be responsible for closing it.Maybe this could be cleared up, either by flipping the responsibilities around to close it from the caller, or by clearly documenting on
setResourceContent
the contract that the implementation is expected to close the stream. (The caveat of the latter being that if there was an issue calling the method, the code which closes the stream might not be called, i.e., the only really safe place to have the closing code is at the caller.)The text was updated successfully, but these errors were encountered: