Remove uses of File#listFiles #449
Reference in New Issue
Block a user
Delete Branch "Remove_listFiles"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The
Fileclass'slistFilesmethod has a disadvantage in that it lists all of a directory's files at once, which can be problematic for directories with a lot of files.This PR switches to using the
DirectoryStreamand file walking APIs introduced in Java 7, which allow files to be lazily loaded on Android 8.0 and later. On Android versions below 8.0, the old API is still used to retrieve the files.It looks good but we really do not want to enable desugaring. I'll look if it possible to use Okio for this
Take a look, I did it in another way without desugaring
Pull request closed