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

DiskFileItemFactory use of FileCleaningTracker is documented or coded wrong

    XMLWordPrintableJSON

Details

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

    Description

      Regarding latest SVN revision:

      The DiskFileItemFactory documents:
      Temporary files are automatically deleted as soon as they are no longer needed. (More precisely, when the corresponding instance of

      {@link java.io.File}

      is garbage collected.)

      But the code in DiskFileItemFactory.createItem() is doing:
      tracker.track(result.getTempFile(), this);

      Which means the file is cleaned when DiskFileItemFactory is garbage collected.

      This error is propably introduced in Rev 578253 when the code was moved from DiskFileItem to DiskFileItemFactory, without changing "this" (which was DiskFileItem) and is not DiskFileItemFactory.

      Attachments

        1. FILEUPLOAD-189.patch
          1 kB
          Jan Novotný

        Issue Links

          Activity

            People

              simone.tripodi Simone Tripodi
              gregork Gregor K
              Votes:
              16 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 1h
                  1h
                  Remaining:
                  Remaining Estimate - 1h
                  1h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified