Skip to content

walkFileTree should return consistently absolute or relative paths. #3772

Description

@jean-philippe-martin

The expected behavior from Files.walkFileTree is that if the starting path is absolute, then all the visited paths are absolute. If the starting path is relative, then all the visited paths are relative.

However, the output of Files.walkFileTree("/dir/") is something like this:

dir/file.txt
dir/dir2/another.txt
dir/dir2/
/dir/

As you can see, only the last entry is absolute. They should be consistent (in this case, they should be absolute).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions