Groovy
  1. Groovy
  2. GROOVY-4390

Add GDK File methods to the NIO2 API

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      The GDK adds a bunch of methods to java.io.File and directory
      searching stuff. We'll need to add some sor tof parity for the new
      NIO2 API.

      The good news is NIO 2 is finished and hasn't changed in a while, and
      it is well documented.

      This is a fun and sort of easy bit of work. Mostly analysis and then a
      bunch of new DGM methods.

        Issue Links

          Activity

          Hide
          malbery added a comment -

          Attached GROOVY-4390_Path_getText.patch. Includes org.codehaus.groovy.vmplugin.v7.PluginDefaultGroovyMethodsTest. I've tested the Ant build behaviour with both Java 1.6 and Java 1.7. When building using Java 1.7 the distribution will include the org.codehaus.groovy.vmplugin.v7.PluginDefaultGroovyMethods methods.

          This patch includes just two new DGM methods:

          • Path.getText()
          • ReadableByteChannel.getText()

          I'll gladly code more DGM methods. Is this general approach to our liking?

          Show
          malbery added a comment - Attached GROOVY-4390 _Path_getText.patch. Includes org.codehaus.groovy.vmplugin.v7.PluginDefaultGroovyMethodsTest. I've tested the Ant build behaviour with both Java 1.6 and Java 1.7. When building using Java 1.7 the distribution will include the org.codehaus.groovy.vmplugin.v7.PluginDefaultGroovyMethods methods. This patch includes just two new DGM methods: Path.getText() ReadableByteChannel.getText() I'll gladly code more DGM methods. Is this general approach to our liking?
          Hide
          malbery added a comment -

          The Java 1.7 test failures highlighted in GROOVY-4391 block this issue IMO.

          Show
          malbery added a comment - The Java 1.7 test failures highlighted in GROOVY-4391 block this issue IMO.
          Hide
          Paul King added a comment -

          Looks good. Some minor things.

          If we were following the conventions currently used in other places, we would use vm7 as the test package even though we use v7 as our plugin package convention. It would be nice if these were aligned. Though to be honest, perhaps we should rename vm6 tests to v6. I'll have to check if there are any ramifications of such a move.

          In the build for the javac task you have source="1.7" target="1.7". Does it actually compile if you drop those values down to 1.6 (or even 1.5)? Just curious.

          Show
          Paul King added a comment - Looks good. Some minor things. If we were following the conventions currently used in other places, we would use vm7 as the test package even though we use v7 as our plugin package convention. It would be nice if these were aligned. Though to be honest, perhaps we should rename vm6 tests to v6. I'll have to check if there are any ramifications of such a move. In the build for the javac task you have source="1.7" target="1.7" . Does it actually compile if you drop those values down to 1.6 (or even 1.5)? Just curious.
          Hide
          malbery added a comment -

          > In the build for the javac task you have source="1.7" target="1.7". Does it actually compile if you drop those values down to 1.6 (or even 1.5)? Just curious.

          I'm pretty sure it's required as we're using 1.7 classes.

          Show
          malbery added a comment - > In the build for the javac task you have source="1.7" target="1.7". Does it actually compile if you drop those values down to 1.6 (or even 1.5)? Just curious. I'm pretty sure it's required as we're using 1.7 classes.
          Hide
          malbery added a comment -

          FYI The blocker, GROOVY-4391, is now resolved thanks to Roshan.

          Show
          malbery added a comment - FYI The blocker, GROOVY-4391 , is now resolved thanks to Roshan.
          Hide
          malbery added a comment -

          I think that this JIRA is now redundant, and this issue and it's patch can be discarded. The Groovy NIO module has a comprehensive set of Path methods.

          Show
          malbery added a comment - I think that this JIRA is now redundant, and this issue and it's patch can be discarded. The Groovy NIO module has a comprehensive set of Path methods.
          Hide
          Pascal Schumacher added a comment -

          As said previously this issue is no longer relevant.

          Could someone with the necessary permissions please close it? Thanks!

          Show
          Pascal Schumacher added a comment - As said previously this issue is no longer relevant. Could someone with the necessary permissions please close it? Thanks!

            People

            • Assignee:
              Unassigned
              Reporter:
              malbery
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development