Skip to content

Commit ce6d93c

Browse files
committed
Remove Files.fileTreeTraverser().
RELNOTES=`io`: Removed deprecated `Files.fileTreeTraverser()` and `MoreFiles.directoryTreeTraverser()`. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=194276111
1 parent 62b40aa commit ce6d93c

File tree

7 files changed

+6
-229
lines changed

7 files changed

+6
-229
lines changed

android/guava-tests/test/com/google/common/io/FileTreeTraverserTest.java

Lines changed: 0 additions & 92 deletions
This file was deleted.

android/guava-tests/test/com/google/common/io/FilesTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@
4343
/**
4444
* Unit test for {@link Files}.
4545
*
46-
* <p>Note: {@link Files#fileTreeTraverser()} is tested in {@link FileTreeTraverserTest} and {@link
47-
* Files#fileTraverser()} is tested in {@link FilesFileTraverserTest}.
46+
* <p>Note: {@link Files#fileTraverser()} is tested in {@link FilesFileTraverserTest}.
4847
*
4948
* @author Chris Nokleberg
5049
*/

android/guava/src/com/google/common/io/Files.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -802,11 +802,10 @@ public static String getNameWithoutExtension(String file) {
802802
*
803803
* @since 15.0
804804
* @deprecated The returned {@link TreeTraverser} type is deprecated. Use the replacement method
805-
* {@link #fileTraverser()} instead with the same semantics as this method. This method is
806-
* scheduled to be removed in April 2018.
805+
* {@link #fileTraverser()} instead with the same semantics as this method.
807806
*/
808807
@Deprecated
809-
public static TreeTraverser<File> fileTreeTraverser() {
808+
static TreeTraverser<File> fileTreeTraverser() {
810809
return FILE_TREE_TRAVERSER;
811810
}
812811

guava-tests/test/com/google/common/io/FileTreeTraverserTest.java

Lines changed: 0 additions & 92 deletions
This file was deleted.

guava-tests/test/com/google/common/io/FilesTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@
4343
/**
4444
* Unit test for {@link Files}.
4545
*
46-
* <p>Note: {@link Files#fileTreeTraverser()} is tested in {@link FileTreeTraverserTest} and {@link
47-
* Files#fileTraverser()} is tested in {@link FilesFileTraverserTest}.
46+
* <p>Note: {@link Files#fileTraverser()} is tested in {@link FilesFileTraverserTest}.
4847
*
4948
* @author Chris Nokleberg
5049
*/

guava/src/com/google/common/io/Files.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -802,11 +802,10 @@ public static String getNameWithoutExtension(String file) {
802802
*
803803
* @since 15.0
804804
* @deprecated The returned {@link TreeTraverser} type is deprecated. Use the replacement method
805-
* {@link #fileTraverser()} instead with the same semantics as this method. This method is
806-
* scheduled to be removed in April 2018.
805+
* {@link #fileTraverser()} instead with the same semantics as this method.
807806
*/
808807
@Deprecated
809-
public static TreeTraverser<File> fileTreeTraverser() {
808+
static TreeTraverser<File> fileTreeTraverser() {
810809
return FILE_TREE_TRAVERSER;
811810
}
812811

guava/src/com/google/common/io/MoreFiles.java

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import com.google.common.base.Optional;
2525
import com.google.common.base.Predicate;
2626
import com.google.common.collect.ImmutableList;
27-
import com.google.common.collect.TreeTraverser;
2827
import com.google.common.graph.SuccessorsFunction;
2928
import com.google.common.graph.Traverser;
3029
import com.google.common.io.ByteSource.AsCharSource;
@@ -267,40 +266,6 @@ public static ImmutableList<Path> listFiles(Path dir) throws IOException {
267266
}
268267
}
269268

270-
/**
271-
* Returns a {@link TreeTraverser} for traversing a directory tree. The returned traverser
272-
* attempts to avoid following symbolic links to directories. However, the traverser cannot
273-
* guarantee that it will not follow symbolic links to directories as it is possible for a
274-
* directory to be replaced with a symbolic link between checking if the file is a directory and
275-
* actually reading the contents of that directory.
276-
*
277-
* <p>Note that if the {@link Path} passed to one of the traversal methods does not exist, no
278-
* exception will be thrown and the returned {@link Iterable} will contain a single element: that
279-
* path.
280-
*
281-
* <p>{@link DirectoryIteratorException} may be thrown when iterating {@link Iterable} instances
282-
* created by this traverser if an {@link IOException} is thrown by a call to {@link
283-
* #listFiles(Path)}.
284-
*
285-
* @deprecated The returned {@link TreeTraverser} type is deprecated. Use the replacement method
286-
* {@link #fileTraverser()} instead with the same semantics as this method. This method is
287-
* scheduled to be removed in April 2018.
288-
*/
289-
@Deprecated
290-
public static TreeTraverser<Path> directoryTreeTraverser() {
291-
return DirectoryTreeTraverser.INSTANCE;
292-
}
293-
294-
private static final class DirectoryTreeTraverser extends TreeTraverser<Path> {
295-
296-
private static final DirectoryTreeTraverser INSTANCE = new DirectoryTreeTraverser();
297-
298-
@Override
299-
public Iterable<Path> children(Path dir) {
300-
return fileTreeChildren(dir);
301-
}
302-
}
303-
304269
/**
305270
* Returns a {@link Traverser} instance for the file and directory tree. The returned traverser
306271
* starts from a {@link Path} and will return all files and directories it encounters.

0 commit comments

Comments
 (0)