JDK-4168045 : File.isReady() - method to avoid media-insertion dialogs
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.io
  • Affected Version: 1.2.0,1.3.1
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_nt,windows_2000
  • CPU: x86
  • Submitted: 1998-08-20
  • Updated: 2006-05-03
  • Resolved: 2006-05-03
Related Reports
Duplicate :  
Description
Name: dm26566			Date: 08/20/98


java.io.File  should have a method isReady() or
isDeviceReady() so that the OS doesn't launch
the infamous Abort/Retry/Cancel dialog when
calling such methods as listFiles(), exists(),
or canRead().

For example if you write a JExplorer (similar
to Windows Explorer) there is no way to listRoots() without throwing the 
NullPointerException or
canRead() without forcing the user to answer
the dialog for devices that are not ready.

Under Unix is the device is not mounted it's not
a root/subdirectory so this issue will never come
up.  However with listRoots() (presumeable for
Windows machines) it is an issue.
(Review ID: 37315)
======================================================================

Comments
EVALUATION -- The issue with the dialog poping up to prompt for media was addressed in mustang b55 - please see the bug evaluation in 4089199.
19-01-2006

WORK AROUND Name: dm26566 Date: 08/20/98 There is no work around as far as I can see other than forcing the user to answer the abort/retry/ cancel dialog on windows platform. ======================================================================
11-06-2004

EVALUATION It would be very nice to implement this, but unfortunately we know of no way to do it on Win32. See also 4089199. -- mr@eng 9/1/1998
01-09-1998