Q:

Hadoop copy a directory?

Is there an HDFS API that can copy an entire local directory to the HDFS? I found an API for copying files but is there one for directories?

A:

Use the Hadoop FS shell. Specifically:
$ hadoop fs -copyFromLocal /path/to/local hdfs:///path/to/hdfs

If you want to do it programmatically, create two FileSystems (one Local and one HDFS) and use the FileUtil class

A:

I tried copying from the directory using 
/hadoop/core/bin/hadoop fs -copyFromLocal /home/grad04/lopez/TPCDSkew/ /export/hadoop1/lopez/Join/TPCDSkew

It gave me an error saying Target is a directory . I then modified it to 
/hadoop/core/bin/hadoop fs -copyFromLocal /home/grad04/lopez/TPCDSkew/*.* /export/hadoop1/lopez/Join/TPCDSkew

it works .

