* @param zipEntry ZIP entry
*/
private static void parseElement ( final JarEntry jarEntry, final String entryName, final ZipEntry zipEntry )
{
final String[] path = entryName.split ( "/" );
JarEntry currentLevel = jarEntry;
for ( int i = 0; i < path.length; i++ )
{
if ( i < path.length - 1 )
{
// We are getting deeper into packages
JarEntry child = currentLevel.getChildByName ( path[ i ] );
if ( child == null )
{
child = new JarEntry ( JarEntryType.packageEntry, path[ i ], currentLevel );
child.setZipEntry ( zipEntry );
currentLevel.addChild ( child );
}
currentLevel = child;
}
else
{
// We reached last element
final JarEntry newEntry = new JarEntry ( getJarEntryType ( path[ i ] ), path[ i ], currentLevel );
newEntry.setZipEntry ( zipEntry );
currentLevel.addChild ( newEntry );
}
}
}