Commons FileUpload
  1. Commons FileUpload
  2. FILEUPLOAD-133

Refactor use of FileCleaner into plugable strategy to allow overriding.

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.2
    • Fix Version/s: None
    • Labels:
      None

      Description

      For applications that do not want to use the FileCleaner service it would be very useful to allow this to be overridden.

      This could be done by refactoring the use of the FileCleaner into a plugable strategy.
      e..g

      interface TemporaryFileCleaner {
      void register(FileItem item, File file );
      }

      The DiskFileItem could have a default implementation of the strategy that invokes FileCleaner.track. However if required an application could supply a different stategy to the factory for use by all the items.

      I'll try to post a patch implementing this in the next couple of days

        Activity

        Hide
        Jochen Wiedmann added a comment -

        The existing implementation already allows to set the FileCleaningTracker to null, in which case your requirements are met. I'll document the possibility, though.

        Show
        Jochen Wiedmann added a comment - The existing implementation already allows to set the FileCleaningTracker to null, in which case your requirements are met. I'll document the possibility, though.
        Hide
        Ben Sommerville added a comment -

        Thanks that covers my need (basically to be able to turn off that service).

        Would be nicer if FileCleaningTracker was an interface to allow for difference impls, but that's not really an file upload issue

        Show
        Ben Sommerville added a comment - Thanks that covers my need (basically to be able to turn off that service). Would be nicer if FileCleaningTracker was an interface to allow for difference impls, but that's not really an file upload issue

          People

          • Assignee:
            Unassigned
            Reporter:
            Ben Sommerville
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development