Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

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


Copy link to this message
-
Re: Error while using "listFiles(File dir)"
I don't have your code to tell you exactly where you are going wrong,
but you seem to be using File with hdfs-URIs, which isn't possible
without some further tweaks. Use proper Path objects with
FileUtil.copy* instead?

On Tue, Mar 20, 2012 at 9:38 AM, Mohammad Tariq <[EMAIL PROTECTED]> wrote:
> 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
> thanks.
>
> Regards,
>     Mohammad Tariq

--
Harsh J
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB