JDK-4755618 : File should support incrementally listing a directory
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.io
  • Affected Version: 1.4.0
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2002-09-30
  • Updated: 2009-02-16
  • Resolved: 2009-02-16
Related Reports
Duplicate :  
Relates :  
Description
Name: nt126004			Date: 09/30/2002


FULL PRODUCT VERSION :
java version "1.4.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-b92)
Java HotSpot(TM) Client VM (build 1.4.0-b92, mixed mode)


A DESCRIPTION OF THE PROBLEM :
we need to be able to get the files of a directory one by
one. Actually, having a long directory list freezes the
program. Ok, i can thread this, and that is what is done to
reduce the mess, but the problems described below can't be
solved anyway:
- show read update progress
- interrupt the read
- read the list up to a desired entry
- get a raw list, unsorted. (because faster than sorted and
sometimes not a necessity)
- have a background thread that would check all file in the
system, without major slowdowns on the system during on big
directories scan.
These are my actual problems in a program i'm actually
creating, that is a pure java attempt of a file system
handler for creating amongst other programs an Explorer like
program, but way smarter.

EXPECTED VERSUS ACTUAL BEHAVIOR :
What i want is the adding of:
public java.util.Enumeration enumerateFiles() throws
IOException;
to java.io.File
should do the job nicely.
I know that Iteration should be prefered to Enumeration, but
in this case, we don't need synchronisation, nor we need the
adding/removing services. thus, it would be more efficient
to use Enumeration.

REPRODUCIBILITY :
This bug can be reproduced always.

CUSTOMER WORKAROUND :
go through JNI, and loose portability.
(Review ID: 160397) 
======================================================================

Comments
EVALUATION This feature has been addressed by the new file system API defined by JSR-203.
16-02-2009

EVALUATION This will be considered as input to the design of the new filesystem API in Tiger. -- ###@###.### 2003/1/31
01-11-0197