Is it possible to discover plugged disks from Java?
-
21-04-2021 - |
Frage
I'm writing a disk crawler and if the user doesn't provide an existing path the program should search all disks that are available. Does anybody know is it possible and if it is how to do that from Java?
Lösung
Try this:
File.listRoots();
Andere Tipps
Only works on windows, on unix based operating system you will have 1 root, independent of the number of disks.
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow