Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8182710

File.listRoots() always returns the root of CD drive

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 8u131, 9
    • Fix Version/s: 10
    • Component/s: core-libs
    • Subcomponent:
    • Resolved In Build:
      b14
    • CPU:
      generic
    • OS:
      windows
    • Verification:
      Not verified

      Description

      File.listRoots() always returns the root of CD drive irrespective of whether the CD is inserted of not. Please find a sample test program attached. The output of the code will always have the root of CD drive irrespective of whether CD is inserted or ejected.
       
      The Javadoc of File.listRoots() http://jre.us.oracle.com/java/re/jdk/9/promoted/latest/docs/api/java/io/File.html#listRoots-- states,
       
      The set of available filesystem roots is affected by various system-level operations such as the insertion or ejection of removable media and the disconnecting or unmounting of physical or virtual disk drives.
       
      As per above documentation, it seems like for an empty CD drive its root should not be included by File.listRoots(). This is an implementation issue and needs to be fixed.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              bpb Brian Burkhalter
              Reporter:
              vkhatri Vinod Khatri
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: