groovy
  1. groovy
  2. GROOVY-403

allow easier recursive file processing with File.eachFileRecurse { ... }

    Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.0-beta-5
    • Component/s: None
    • Labels:
      None
    • Number of attachments :
      0

      Description

      There's an interesting discussion here...

      http://wiki.codehaus.org/groovy/FileSupport

      one thought was recursive deletion...

      def recursiveDelete(File file) {
      outer = this
      if( file.isDirectory() ) {
      file.eachFile

      { outer.recursiveDelete(it) }

      }

      file.delete()
      }

      I wondered if we should have a recursive file method where you could do

      new File("/home/foo").eachFileRecurse

      { println it.name }

      which would iterate through all files recursively like the above - calling children first before parents.

      Then a recursive delete would be

      file.eachFileRecurse

      { it.delete() }

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Guillaume Laforge
            Reporter:
            james strachan
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: