title: Control sort order of files in zip archive
body: <h3>Description</h3>
  <p>I'm interested in learning if there is any way to control sort order of files inside zip files using standard routines in PHP and/or Java.</p>
  <p>I'm not primarily interested in using zip/unzip using <code>shell_exec()</code> or similar, but it can be of interest if it provides with an easy to read solution.</p>
  <p>With sort order it's safe to assume it means date/time if no sort order is available within the zip file. I've not read the specs so I wouldn't know.</p>
  <h3>Example</h3>
  <p><em>Files</em></p>
  <p>foo.txt<br />
  bar.txt<br />
  test.txt<br />
  newfile.txt</p>
  <p>Let's assume that each file contains the name of the file (foo.txt =&gt; foo.txt)</p>
  <p><em>Problem</em></p>
  <p>I want to attach a sort order to the files so that when unpacked using <code>unzip</code> the files end up in the right order. This is important why? Because i use <code>unzip -p</code> to pipe the content of the zip file.</p>
  <p>The order in which the files are added to the archive should not matter.</p>
  <p><em>Result</em></p>
  <p>Intended result (for the sake of this example (using unzip -p))</p>
  <p>test.txt<br />
  foo.txt<br />
  newfile.txt<br />
  bar.txt</p>