title: Adding a directory of files to Hadoop using distributed cache?
body: <p>I'm trying to add a bunch of dependencies stored on hdfs to distributed cache.  I've been following the advice from this article: <a href="http://www.datasalt.com/2011/05/handling-dependencies-and-configuration-in-java-hadoop-projects-efficiently/" rel="nofollow">http://www.datasalt.com/2011/05/handling-dependencies-and-configuration-in-java-hadoop-projects-efficiently/</a>.  My question is: is it possible to add a folder containing the dependencies to the classpath?  </p>
  
  <pre><code>DistributedCache.addFileToClassPath(new Path("/tmp/lib/"), job.getConfiguration());
  </code></pre>
  
  <p>Or would I need to add each dependency individually?</p>
  
  <pre><code>for (Path dependency : dependencies) {
     DistributedCache.addFileToClassPath(dependency, job.getConfiguration());
  }
  </code></pre>
  
  <p>And how would I check that the dependencies were actually added to the classpath on all the slave nodes?</p>
  
  <p>Thanks.</p>