DirectoryStream<Path> lists files in a haphazard manner
问题 I have to retrieve a set of JPG files from the folder so that I can create a movie with it. The problem is that the files are listed in a haphazard manner and hence are processed in a haphazard manner. Here is a screenshot: I need them in a sequential manner as img0,img1.....imgn How do I do that? **I deveopled a custom sorting scheme but I get an exception. The coding is given here: " try{ int totalImages = 0; int requiredImage = 0; jpegFiles = Files.newDirectoryStream(Paths.get(pathToPass)