title: Remove a directory when unzipping
body: <p>I am unpacking a zip file into a directory.  The zip file has an extra top level directory that I don't want in the unzipped destination.  </p>
  
  <pre><code>task unpackDojoSource(type: Copy) {
      new File("build/dojo/src").mkdirs()
      from(zipTree(dojoSource)) {
          eachFile { details -&gt; details.path = 
             details.path.substring(details.relativePath.segments[0].length()) } 
      } into "build/dojo/src"
  }
  </code></pre>
  
  <p>The task produces the following output</p>
  
  <pre><code>/dijit
  /dojo
  /dojo-release-1.7.2
     /dijit
     /dojo
     /dojox
     /util
  /dojox
  /util
  </code></pre>
  
  <p>Is there a way I can prevent the dojo-release directory from being created?</p>
  
  <p>Ref:
  <a href="http://gradle.markmail.org/thread/x6gmbrhhen63rybe#query:+page:1+mid:lws7nlqcncjumnvs+state:results" rel="nofollow">http://gradle.markmail.org/thread/x6gmbrhhen63rybe#query:+page:1+mid:lws7nlqcncjumnvs+state:results</a></p>