long beforeArchiveWrite = tmp[0].lastModified();
CpioArchiveEntry in = new CpioArchiveEntry("foo/");
in.setTime(beforeArchiveWrite / 1000);
in.setMode(CpioConstants.C_ISDIR);
tos.putArchiveEntry(in);
tos.closeArchiveEntry();
tos.close();
tos = null;
tis = new CpioArchiveInputStream(new FileInputStream(archive));
CpioArchiveEntry out = tis.getNextCPIOEntry();
tis.close();