title: finding the last common directory in a jar file
body: <p>Is there a way to extract the last common directory structure in a jar file ?
  For example,</p>
  
  <pre><code>jar -tf test.jar
  
  META-INF/
  META-INF/MANIFEST.MF
  com/
  com/a/
  com/a/b/
  com/a/b/c/
  com/a/b/c/file1.class
  com/a/b/d/
  com/a/b/d/file2.class
  Manifest.txt
  </code></pre>
  
  <p>The last common directory structure would be </p>
  
  <pre><code>com/a/b
  </code></pre>
  
  <p>I can code something in java/bash to just split by / and see if there is anything common with the next string, but I was wondering if there is a magical jar option that will save me some time.</p>