How to detect a usb drive in Java
问题 I would like to know how to detect a usb drive. I have already read this post but I am interested in knowing if we can just use java.io.*; to check for the usb drive. The post that i have read up, does kind of explain how to use java.io.*; but I didn't quite understand. If someone could provide an example, that would be great. Thank you. 回答1: You could you the File.listRoots() Method. There is a Post about that: Post on Stackoverflow on File.listRoots() The problem here is that you would need