Skip to content

Commit

Permalink
Make example compile (i.e. supply a Path/File) and use depth first in…
Browse files Browse the repository at this point in the history
…stead of breadth first.

Reason: Depth first is more common for file traversal.

RELNOTES=N/A

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=223782436
  • Loading branch information
nymanjens authored and ronshapiro committed Dec 5, 2018
1 parent 920e72f commit 3dfee64
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
5 changes: 3 additions & 2 deletions android/guava/src/com/google/common/io/Files.java
Original file line number Diff line number Diff line change
Expand Up @@ -828,8 +828,9 @@ public String toString() {
* a directory, no exception will be thrown and the returned {@link Iterable} will contain a
* single element: that file.
*
* <p>Example: {@code Files.fileTraverser().breadthFirst("/")} may return files with the following
* paths: {@code ["/", "/etc", "/home", "/usr", "/etc/config.txt", "/etc/fonts", ...]}
* <p>Example: {@code Files.fileTraverser().depthFirstPreOrder(new File("/"))} may return files
* with the following paths: {@code ["/", "/etc", "/etc/config.txt", "/etc/fonts", "/home",
* "/home/alice", ...]}
*
* @since 23.5
*/
Expand Down
5 changes: 3 additions & 2 deletions guava/src/com/google/common/io/Files.java
Original file line number Diff line number Diff line change
Expand Up @@ -828,8 +828,9 @@ public String toString() {
* a directory, no exception will be thrown and the returned {@link Iterable} will contain a
* single element: that file.
*
* <p>Example: {@code Files.fileTraverser().breadthFirst("/")} may return files with the following
* paths: {@code ["/", "/etc", "/home", "/usr", "/etc/config.txt", "/etc/fonts", ...]}
* <p>Example: {@code Files.fileTraverser().depthFirstPreOrder(new File("/"))} may return files
* with the following paths: {@code ["/", "/etc", "/etc/config.txt", "/etc/fonts", "/home",
* "/home/alice", ...]}
*
* @since 23.5
*/
Expand Down
5 changes: 3 additions & 2 deletions guava/src/com/google/common/io/MoreFiles.java
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,9 @@ public static ImmutableList<Path> listFiles(Path dir) throws IOException {
* created by this traverser if an {@link IOException} is thrown by a call to {@link
* #listFiles(Path)}.
*
* <p>Example: {@code MoreFiles.fileTraverser().breadthFirst("/")} may return files with the
* following paths: {@code ["/", "/etc", "/home", "/usr", "/etc/config.txt", "/etc/fonts", ...]}
* <p>Example: {@code MoreFiles.fileTraverser().depthFirstPreOrder(Paths.get("/"))} may return the
* following paths: {@code ["/", "/etc", "/etc/config.txt", "/etc/fonts", "/home", "/home/alice",
* ...]}
*
* @since 23.5
*/
Expand Down

0 comments on commit 3dfee64

Please sign in to comment.