File base = null;
for ( Iterator iter = resources.keySet().iterator(); iter.hasNext(); )
{
String name = (String) iter.next();
ArchiveEntry entry = (ArchiveEntry) resources.get( name );
name = name.replace( File.separatorChar, '/' );
if ( "".equals( name ) )
{
continue;
}
if ( entry.getFile().isDirectory() && !name.endsWith( "/" ) )
{
name = name + "/";
}
addParentDirs( base, name, zOut, "" );
if ( entry.getFile().isFile() )
{
zipFile( entry, zOut, name );
}
else
{
zipDir( entry.getFile(), zOut, name, entry.getMode() );
}
}
}