samuelcampos / usbdrivedetector

A Java library to get a list of all usb storage devices connected to the computer.
MIT License
128 stars 46 forks source link

Quick Question #9

Closed flexpeace closed 5 years ago

flexpeace commented 8 years ago

Does your Library has a callback method that informs the Java Application a new USB inserted? Or it has to be done manually using some of thread?

Can your Library be adapted for other drives such C: or D:?

samuelcampos commented 8 years ago

The purpose of this library is to notify a Java Application when an USB storage is inserted or removed.

It uses an internal daemon thread to catch those events. I need to update the README file to include an usage example, but you can see one here: https://github.com/samuelcampos/usbdrivedetector/blob/master/src/test/java/net/samuelcampos/usbdrivedectector/SimpleTest.java

At this moment, this library is based on a pooling mechanism. But I'll try to update it soon in order to catch those events directly from the OS.