// TODO: revisit - does AR not support storing directories?
public void XtestExplicitDirectoryEntry() throws Exception {
File[] tmp = createTempDirAndFile();
File archive = null;
ArArchiveOutputStream aos = null;
ArArchiveInputStream ais = null;
try {
archive = File.createTempFile("test.", ".ar", tmp[0]);
archive.deleteOnExit();
aos = new ArArchiveOutputStream(new FileOutputStream(archive));
long beforeArchiveWrite = tmp[0].lastModified();
ArArchiveEntry in = new ArArchiveEntry("foo", 0, 0, 0, 0,
tmp[1].lastModified() / 1000);
aos.putArchiveEntry(in);
aos.closeArchiveEntry();
aos.close();
aos = null;
ais = new ArArchiveInputStream(new FileInputStream(archive));
ArArchiveEntry out = ais.getNextArEntry();
ais.close();
ais = null;
assertNotNull(out);
assertEquals("foo/", out.getName());
assertEquals(0, out.getSize());
assertEquals(beforeArchiveWrite / 1000,
out.getLastModifiedDate().getTime() / 1000);
assertTrue(out.isDirectory());
} finally {
if (ais != null) {
ais.close();
}
if (aos != null) {
aos.close();
}
if (archive != null) {
archive.delete();
}
tmp[1].delete();