Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-5945

Full cutover to Path api from java.io.File

    XMLWordPrintableJSON

Details

    • Task
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 5.0, 6.0
    • None
    • None
    • New

    Description

      Using NIO2 has a lot of benefits:

      • more fine grained exception handling
      • clearer semantics about what happens
      • additional functionality
      • possibility to work with virtual filesystems, etc.

      We already banned File.delete and switched to Files.delete, I think we should ban File completely (except for some sugar methods that just forward with .toPath, like FSDirectory.open)

      For tests, ideally we go a little further and ban methods like FileSystems.getDefault(). Instead we could exempt LuceneTestCase and ensure all Paths are created via one protected method. This leaves open the possibility to mock up filesystem behavior at a lower level in tests in the future.

      Attachments

        1. LUCENE-5945_core.patch
          120 kB
          Robert Muir
        2. LUCENE-5945.patch
          468 kB
          Robert Muir

        Issue Links

          Activity

            People

              Unassigned Unassigned
              rcmuir Robert Muir
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: