Class DirectoryTraversal


  • @Deprecated
    public final class DirectoryTraversal
    extends java.lang.Object
    Deprecated.
    It is currently an EXPERIMENTAL feature meant for internal use only. It may be changed incompatibly or removed in a future version.
    This class wraps the directory traversal implementation provided by the CRT.
    • Constructor Detail

      • DirectoryTraversal

        public DirectoryTraversal()
        Deprecated.
    • Method Detail

      • traverse

        public static void traverse​(java.lang.String path,
                                    boolean recursive,
                                    DirectoryTraversalHandler handler)
        Deprecated.
        Traverse a directory starting at the path provided. If you want the traversal to recurse the entire directory, pass recursive as true. Passing false for this parameter will only iterate the contents of the directory, but will not descend into any directories it encounters. If recursive is set to true, the traversal is performed post-order, depth-first (for practical reasons such as deleting a directory that contains subdirectories or files). The traversal iteration can be cancelled by the user by returning false from the callback. If the traversal is cancelled either returning false from the callback or an unhandled exception is thrown from the callback, the traverse method will throw a RuntimeException to notify user about incomplete results.
        Parameters:
        path - directory to traverse.
        recursive - true to recurse the entire directory, false will only iterate the path specified
        handler - callback to invoke for each file or directory found during the traversal.