Uploaded image for project: 'Commons FileUpload'
  1. Commons FileUpload
  2. FILEUPLOAD-234

Bug in docs: tmp file delete conditions in "Resource Cleanup" section of "using.html"

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.3
    • 1.4
    • None

    Description

      The guide at http://commons.apache.org/proper/commons-fileupload/using.html incorrectly writes: "Such temporary files are deleted automatically, if they are no longer used (more precisely, if the corresponding instance of java.io.File is garbage collected.".

      (The following affects maven version: http://search.maven.org/#artifactdetails|commons-fileupload|commons-fileupload|1.2.2|jar )

      However, the code for org.apache.commons.io.FileCleaningTracker.Tracker.Tracker(...) passes org.apache.commons.fileupload.disk.DiskFileItemFactory.this specified by org.apache.commons.fileupload.disk.DiskFileItemFactory.createItem(String, String, boolean, String) in tracker.track(result.getTempFile(), this), and not java.io.File. I.e. the "using.html" guide must be corrected.

      The correct (fixed) phrasing is:

      "Such temporary files are deleted automatically, if they are no longer used (more precisely, if the corresponding instance of org.apache.commons.fileupload.disk.DiskFileItemFactory is garbage collected.".

      (The following affects maven version: http://search.maven.org/#artifactdetails|commons-fileupload|commons-fileupload|1.3|jar )

      However, the code for org.apache.commons.io.FileCleaningTracker.Tracker.Tracker(...) passes DiskFileItem.this specified by org.apache.commons.fileupload.disk.DiskFileItemFactory.createItem(String, String, boolean, String) in DiskFileItem result=[...]; [...]; tracker.track(result.getTempFile(), result), and not java.io.File. I.e. the "using.html" guide must be corrected.

      The correct (fixed) phrasing is:

      "Such temporary files are deleted automatically, if they are no longer used (more precisely, if the corresponding instance of org.apache.commons.fileupload.disk.DiskFileItem is garbage collected.".

      (The following holds for both versions 1.2.2 and 1.3)

      The correct (fixed) phrasing is:

      "Such temporary files are deleted automatically, if they are no longer used (more precisely, if the corresponding instance of org.apache.commons.fileupload.disk.DiskFileItem (for commons-fileupload v.1.3) and instance of org.apache.commons.fileupload.disk.DiskFileItemFactory (for commons-fileupload v.1.2.2) is garbage collected.".

      Attachments

        Issue Links

        Activity

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

          People

            Unassigned Unassigned
            egphilippov Evgeniy Philippov
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment