title: Java- Recursively Get the path of directorys with files on it
body: <p>How do i recursively get the path of directorys with files on it?</p>
  <p>Im writing a program that needs to get the path of all the directories with JAVA files on it, recursively, for example:</p>
  <pre><code>|   |--&gt;Foo2 --&gt; lore.java
  |Foo|
  |   |--&gt;Foo3 --&gt; Foo4 --&gt; ipsum.java
  </code></pre>
  <p>In this example, I would want to save in a list: FOO/FOO2 and FOO/FOO3/FOO4. There may be more nested directories, and those directories might contain java files, an example might be:</p>
  <pre><code>|
  |   |--&gt; Foo2 --&gt; lore.java
  |   |
  |Foo|         | --&gt; ipsum.java
  |   |--&gt; Foo3 |
  |   |         | --&gt; Foo4 --&gt; rosae.java
  </code></pre>
  <p>In this example, i would want to save FOO/FOO2, FOO/FOO3 and FOO/FOO3/FOO4.
  Any ideas? Thanks!</p>