Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: watching for new connected external storage devices in Java?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: watching for new connected external storage devices in Java?



couldn't you just scan the file system roots every now and then to see if anything has changed?
On Nov 26, 2010, at 7:40 AM, Bob Lang wrote:

> Hi Tobias
>
> On 26 Nov 2010, at 13:35, Tobias Bley wrote:
>
>> does anybody know a good solution in Java for watching for new connected external storage devices? (external hard disc, usb stick, ...)
>>
>> I tried the FileMonitor of JNA but this approach doesn't seems to work...
>
> Unless someone here comes up with a really elegant solution and assuming that this functionality is NOT a deal-breaker, then my suggestion is that you don't even try!  Any solution you come up with is likely to be different for Windoze and *Nix code bases, which means you really should check it on XP, Vista , Win 7, Linux, Solaris, OS X Leopard, Snow Leopard and Lion.  That's an awful lot of platforms, and of course it only requires a change to any one of them to make your carefully constructed solution fall over.
>
> If I had to do this, then I would put a button/menu on the application GUI for the user to inform the program that a new drive is installed, then use a File Chooser to select it.  This is a pure Java solution and guaranteed to work cross-platform, now and for the foreseeable future.
>
> Best wishes
>
> Bob
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Java-dev mailing list      (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden

Blasting forth in three part harmony!

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >watching for new connected external storage devices in Java? (From: Tobias Bley <email@hidden>)
 >Re: watching for new connected external storage devices in Java? (From: Bob Lang <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.