Hi, When a directory isn't readable we would return null, but applications expect an empty list of files. This is according to the docs which say that null is only returned if the File isn't an directory. And we do check that first.
2006-11-25 Mark Wielaard <[EMAIL PROTECTED]>
* java/io/File.java (list): Return empty list for unreadable dirs.
Committed,
Mark
diff -u -r1.67 File.java
--- java/io/File.java 21 Aug 2006 13:16:31 -0000 1.67
+++ java/io/File.java 25 Nov 2006 22:34:15 -0000
@@ -754,8 +754,9 @@
String files[] = VMFile.list(path);
// Check if an error occured in listInternal().
+ // This is an unreadable directory, pretend there is nothing inside.
if (files == null)
- return null;
+ return new String[0];
if (filter == null)
return files;
signature.asc
Description: This is a digitally signed message part
