Uploaded image for project: 'Struts 2'
  1. Struts 2
  2. WW-4673

InputFileStream not closed in Stream results

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 2.5
    • 2.5.5
    • Core Results
    • None
    • Important

    Description

      In StreamResult's versions prior to 2.5 the input stream was correctly closed:

      try {
         get inputStream
         if (inputStream == null)
              throw Exception
         get outputStream
      } finally {
         if inputStream != null inputStream.close()
         if outputStream != null outputStream.close()
      }
      

      Starting from version 2.5 input stream is not closed anymore. This breaks compatibility for applications that relied on this hook:
      http://stackoverflow.com/questions/4693968/is-there-an-existing-fileinputstream-delete-on-close

      Attachments

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            pperliti Paolo Perliti
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment