src/main/java/org/codehaus/plexus/archiver/zip/AbstractZipArchiver.java
@SuppressWarnings({"JavaDoc"})
    private void addParentDirs( ArchiveEntry archiveEntry, File baseDir, String entry, ZipArchiveOutputStream zOut,
                                String prefix )
        throws IOException
    {
        if ( !doFilesonly && getIncludeEmptyDirs() )
        {
            Stack<String> directories = new Stack<String>();

            // Don't include the last entry itself if it's
            // a dir; it will be added on its own.
            int slashPos = entry.length() - ( entry.endsWith( "/" ) ? 1 : 0 );

            while ( ( slashPos = entry.lastIndexOf( '/', slashPos - 1 ) ) != -1 )
            {
                String dir = entry.substring( 0, slashPos + 1 );

                if ( addedDirs.contains( prefix + dir ) )
                {
                    break;
                }

                directories.push( dir );
            }

            while ( !directories.isEmpty() )
            {
                String dir = directories.pop();
                File f;
                if ( baseDir != null )
                {
                    f = new File( baseDir, dir );
                }
                else
                {
                    f = new File( dir );
                }
				// the
				// At this point we could do something like read the atr
				final PlexusIoResource res = new AnonymousResource( f);
                zipDir( res, zOut, prefix + dir, archiveEntry.getDefaultDirMode() );
            }
        }
    }
@SuppressWarnings({"JavaDoc"})
    private void addParentDirs( ArchiveEntry archiveEntry, File baseDir, String entry, ZipArchiveOutputStream zOut,
                                String prefix )
        throws IOException
    {
        if ( !doFilesonly && getIncludeEmptyDirs() )
        {
            Stack<String> directories = new Stack<String>();

            // Don't include the last entry itself if it's
            // a dir; it will be added on its own.
            int slashPos = entry.length() - ( entry.endsWith( "/" ) ? 1 : 0 );

            while ( ( slashPos = entry.lastIndexOf( '/', slashPos - 1 ) ) != -1 )
            {
                String dir = entry.substring( 0, slashPos + 1 );

                if ( addedDirs.contains( prefix + dir ) )
                {
                    break;
                }

                directories.push( dir );
            }

            while ( !directories.isEmpty() )
            {
                String dir = directories.pop();
                File f;
                if ( baseDir != null )
                {
                    f = new File( baseDir, dir );
                }
                else
                {
                    f = new File( dir );
                }
				// the
				// At this point we could do something like read the atr
				final PlexusIoResource res = new AnonymousResource( f);
                zipDir( res, zOut, prefix + dir, archiveEntry.getDefaultDirMode() );
            }
        }
    }
@ SuppressWarnings ( { "JavaDoc" } ) private void addParentDirs ( ArchiveEntry archiveEntry , File baseDir , String entry , ZipArchiveOutputStream zOut , String prefix ) throws IOException { if ( ! doFilesonly && getIncludeEmptyDirs ( ) ) { Stack < String > directories = new Stack < String > ( ) ; // Don't include the last entry itself if it's // a dir; it will be added on its own. int slashPos = entry . length ( ) - ( entry . endsWith ( "/" ) ? 1 : 0 ) ; while ( ( slashPos = entry . lastIndexOf ( ' ' , slashPos - 1 ) ) != - 1 ) { String dir = entry . substring ( 0 , slashPos + 1 ) ; if ( addedDirs . contains ( prefix + dir ) ) { break ; } directories . push ( dir ) ; } while ( ! directories . isEmpty ( ) ) { String dir = directories . pop ( ) ; File f ; if ( baseDir != null ) { f = new File ( baseDir , dir ) ; } else { f = new File ( dir ) ; } // the // At this point we could do something like read the atr final PlexusIoResource res = new AnonymousResource ( f ) ; zipDir ( res , zOut , prefix + dir , archiveEntry . getDefaultDirMode ( ) ) ; } } }
Ensure all parent dirs of a given entry have been added.

This method is computed in terms of the potentially remapped entry (that may be disconnected from the file system)
we do not *relly* know the entry's connection to the file system so establishing the attributes of the parents can
be impossible and is not really supported.
Ensure all parent dirs of a given entry have been added .