Package org.gnome.gio

Class FileEnumerator

java.lang.Object
All Implemented Interfaces:
Proxy

@Generated("io.github.jwharm.JavaGI") public class FileEnumerator extends GObject
GFileEnumerator allows you to operate on a set of File objects, returning a FileInfo structure for each file enumerated (e.g. File.enumerateChildren(java.lang.String, java.util.Set<org.gnome.gio.FileQueryInfoFlags>, org.gnome.gio.Cancellable) will return a GFileEnumerator for each of the children within a directory).

To get the next file's information from a GFileEnumerator, use nextFile(org.gnome.gio.Cancellable) or its asynchronous version, nextFilesAsync(int, int, org.gnome.gio.Cancellable, org.gnome.gio.AsyncReadyCallback). Note that the asynchronous version will return a list of FileInfo objects, whereas the synchronous will only return the next file in the enumerator.

The ordering of returned files is unspecified for non-Unix platforms; for more information, see Dir.readName(). On Unix, when operating on local files, returned files will be sorted by inode number. Effectively you can assume that the ordering of returned files will be stable between successive calls (and applications) assuming the directory is unchanged.

If your application needs a specific ordering, such as by name or modification time, you will have to implement that in your application code.

To close a GFileEnumerator, use close(org.gnome.gio.Cancellable), or its asynchronous version, closeAsync(int, org.gnome.gio.Cancellable, org.gnome.gio.AsyncReadyCallback). Once a GFileEnumerator is closed, no further actions may be performed on it, and it should be freed with GObject.unref().