How do you, through Java, list all files (recursively) under a certain path in HDFS. I went through the API and noticed FileSystem.listFiles(Path,boolean) but it looks like that method doesn’t exist in my instance of FileSystem when I initialize it.
Share
You can look at the source for
org.apache.hadoop.fs.FsShell.ls(FileStatus, FileSystem, boolean, boolean)for your version of hadoop – this is what is called when you perform ahadoop fs -lsr pathfrom the command line