hadoop-hdfs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Harsh J <ha...@cloudera.com>
Subject Re: Error while using "listFiles(File dir)"
Date Tue, 20 Mar 2012 05:01:44 GMT
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 <dontariq@gmail.com> 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

View raw message