Comments (2)
We use diferent strategies to find drives on different systems. That might explain the different behaviour between Windows and Linux.
On Windows, it is not detecting DriveType 3
because I was not able to distinguish between an external disk DriveType 3
and the computer's default hard disk.
I think that Windoes detects USB sticks as DriveType 2
regardless of the filesystem. However, it does not behave the same for external hard drives.
At this point, my only idea is to expose some config or input parameter for the developer to choose if he wants to detect changes (connections/removals) of normal hard drives (all devices with DriveType 3
).
What do you think?
from usbdrivedetector.
Apologies for not answering earlier. I think an option to configure any fixed/stationary HDD of DriveType 3 would be a valid solution. Maybe a blacklist and whitelist configuration option could solve what to monitor and not.
I almost implemented a sort of "whitelist" myself. Inside the monitor I only want to trigger my application when the usb stick is named "x". All other usb findings are being ignored.
detector.addDriveListener(e -> {
var device = e.getStorageDevice();
if(isCorrectDevice(device) && e.getEventType().equals(DeviceEventType.CONNECTED)) {
// get/put files from/to device
}
});
from usbdrivedetector.
Related Issues (20)
- should depend on logging api and not logging implementation HOT 2
- Windows 10 is not supported HOT 2
- Licensing HOT 3
- Listener Takes time to update status HOT 3
- Access to device HOT 5
- Is there any way to retreive Vendor ID and Product Id from removable devices? HOT 6
- Typo in API? HOT 1
- USBDriveListener settings ? HOT 1
- Errors in the workspace after checkout master HOT 2
- Cannot set polling interval HOT 4
- Leaks native memory under Windows HOT 3
- Abnormal command termination HOT 1
- Regarding external hard disk HOT 4
- > The file system shouldn't mater. It should work with FAT32 HOT 10
- Maven central not updated with recent version 2.2 HOT 7
- usbdrivedetector library returns empty value with the getRemovableDevices() function with MAC OS with JRE version 1.8.0_341-b10 HOT 4
- .unmount() doesn't work at all for Windows 10
- [BUG] Polling thread should be a daemon thread. HOT 1
- Quick Question HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from usbdrivedetector.