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

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

XMLWordPrintable

    • b14
    • generic
    • windows
    • Not verified

      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.

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

              Created:
              Updated:
              Resolved: