Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
HDFS >> mail # user >> Error while using "listFiles(File dir)"

Copy link to this message
Error while using "listFiles(File dir)"
Hello list,

   I am trying to list all the files present in a Hdfs directory using
"listFiles(File dir)", but I am getting the following error -

   Exception in thread "main" java.lang.IllegalArgumentException: URI
scheme is not "file"
at java.io.File.<init>(File.java:383)
at filereader2.TransferFileToHDFS.main(TransferFileToHDFS.java:36)

  Why is it expecting the scheme not to be "hdfs", even when I am
using the "org.apache.hadoop.fs.FileUtil"??

  I am creating a File object using the URI of the hdfs directory in
which all the files, I am trying to list down, are present.May be I am
missing something or committing some mistake.Need some help.Many

    Mohammad Tariq