IBM / JTOpen

IBM Toolbox for Java, an IBM i communications library
https://ibm.github.io/JTOpen/
Other
60 stars 28 forks source link

deprecation: `IFSFile.listFiles()` #45

Open ThePrez opened 1 year ago

ThePrez commented 1 year ago

This has long been a memory consumption problem and a performance problem when listing contents of a directory with many files therein. I've had programs run out of memory because of populating a large array. In my experience. The Enumeration flavors are always better.

This issue proposes marking the four flavors of listFiles() as deprecated with alternatives being new functions that return a List<IFSFile>. The List<IFSFile> would have the benefit of easier use and better efficiency (it would wrap the current Enumeration support and load incrementally). It's unfortunate that the current functions have list in the name. If we were to add another variant, it would be something like listFilesList() or listFilesAsList(). Eew

@jeber-ibm, thoughts?

sumitdethe27 commented 1 year ago

Hey @ThePrez i want to work on this