title: Passing Hadoop program commands through Java Program
body: <p>Can anyone please let me know if there is any way to pass hadoop commands to hdfs (eg: create for delete directory and files"hadoop fs -mkdir /test") from java program? I am trying to create and delete directory and files in hdfs through java program. </p>
  
  <p>Also is there any way to check the size of the files/directory in hdfs through java program. I am trying to check the size of the directory in hdfs and if the size is 0 then I want to delete that file. I need to do all these things through java program. </p>
  
  <p>Please help.  </p>