Package org.codehaus.plexus.archiver.zip

Examples of org.codehaus.plexus.archiver.zip.ZipEntry


    ZipFile zip = null;
    try {
      zip = new ZipFile(jarFile);
      final Enumeration files = zip.getEntries();
      while (files.hasMoreElements()) {
        final ZipEntry nextEntry = (ZipEntry) files.nextElement();
        if (nextEntry == null || nextEntry.isDirectory()) {
          continue;
        }
        final String name = nextEntry.getName();
        if (name.equals("META-INF/tobago-theme.xml") || name.equals("META-INF/tobago-config.xml")) {
          XmlStreamReader xsr = null;
          try {
            final StringWriter stringWriter = new StringWriter();
            xsr = ReaderFactory.newXmlReader(zip.getInputStream(nextEntry));
View Full Code Here


            zf = new ZipFile( file, "utf-8" );
            Enumeration entries = zf.getEntries();
            HashSet dirSet = new HashSet();
            while ( entries.hasMoreElements() )
            {
                ZipEntry ze =
                    (ZipEntry) entries.nextElement();
                String name = ze.getName();
                // avoid index for manifest-only jars.
                if (!name.equals(META_INF_NAME) && !name.equals(META_INF_NAME+"/") &&
                        !name.equals(INDEX_NAME) && !name.equals(MANIFEST_NAME))
                {
                    if ( ze.isDirectory() )
                    {
                        dirSet.add( name );
                    }
                    else if ( name.indexOf( "/" ) == -1 )
                    {
View Full Code Here

        //validate contents of jar file
        ZipFile jar = new ZipFile( generatedFile );
        Set<String> set = new HashSet<String>();
        for( Enumeration<ZipEntry> entries = jar.getEntries(); entries.hasMoreElements(); )
        {
            ZipEntry entry = entries.nextElement();
            set.add( entry.getName() );
        }

        assertTrue( set.contains( "stylesheet.css" ) );
        float javadocVersion = (Float) getVariableValueFromObject( mojo, "fJavadocVersion" );
        if ( Float.compare( javadocVersion, 1.7f ) < 0 )
View Full Code Here

    private int getSizeOfExpectedFiles( Enumeration entries, List expectedFiles )
    {
        while( entries.hasMoreElements() )
        {
            ZipEntry entry = ( ZipEntry ) entries.nextElement();

            if( expectedFiles.contains( entry.getName() ) )
            {
                expectedFiles.remove( entry.getName() );
                assertFalse( expectedFiles.contains( entry.getName() ) );
            }
            else
            {
                fail( entry.getName() + " is not included in the expected files" );
            }
        }
        return expectedFiles.size();
    }
View Full Code Here

        //validate contents of jar file
        ZipFile jar = new ZipFile( generatedFile );
        Set<String> set = new HashSet<String>();
        for( Enumeration<ZipEntry> entries = jar.getEntries(); entries.hasMoreElements(); )
        {
            ZipEntry entry = entries.nextElement();
            set.add( entry.getName() );
        }

        assertTrue( set.contains( "stylesheet.css" ) );
        assertTrue( set.contains( "resources/inherit.gif" ) );
        assertTrue( set.contains( "javadocjar/def/package-use.html" ) );
View Full Code Here

            zf = new ZipFile( file, "utf-8" );
            Enumeration entries = zf.getEntries();
            HashSet dirSet = new HashSet();
            while ( entries.hasMoreElements() )
            {
                ZipEntry ze =
                    (ZipEntry) entries.nextElement();
                String name = ze.getName();
                // META-INF would be skipped anyway, avoid index for
                // manifest-only jars.
                if ( !name.startsWith( "META-INF/" ) )
                {
                    if ( ze.isDirectory() )
                    {
                        dirSet.add( name );
                    }
                    else if ( name.indexOf( "/" ) == -1 )
                    {
View Full Code Here

            zf = new ZipFile( file, "utf-8" );
            Enumeration entries = zf.getEntries();
            HashSet dirSet = new HashSet();
            while ( entries.hasMoreElements() )
            {
                ZipEntry ze =
                    (ZipEntry) entries.nextElement();
                String name = ze.getName();
                // avoid index for manifest-only jars.
                if (!name.equals(META_INF_NAME) && !name.equals(META_INF_NAME+"/") &&
                        !name.equals(INDEX_NAME) && !name.equals(MANIFEST_NAME))
                {
                    if ( ze.isDirectory() )
                    {
                        dirSet.add( name );
                    }
                    else if ( name.indexOf( "/" ) == -1 )
                    {
View Full Code Here

            zf = new ZipFile( file, "utf-8" );
            Enumeration entries = zf.getEntries();
            HashSet dirSet = new HashSet();
            while ( entries.hasMoreElements() )
            {
                ZipEntry ze =
                    (ZipEntry) entries.nextElement();
                String name = ze.getName();
                // avoid index for manifest-only jars.
                if (!name.equals(META_INF_NAME) && !name.equals(META_INF_NAME+"/") &&
                        !name.equals(INDEX_NAME) && !name.equals(MANIFEST_NAME))
                {
                    if ( ze.isDirectory() )
                    {
                        dirSet.add( name );
                    }
                    else if ( name.indexOf( "/" ) == -1 )
                    {
View Full Code Here

                zf = new ZipFile( file, "utf-8" );
                Enumeration<ZipEntry> entries = zf.getEntries();
                HashSet<String> dirSet = new HashSet<String>();
                while ( entries.hasMoreElements() )
                {
                    ZipEntry ze = entries.nextElement();
                    String name = ze.getName();
                    // avoid index for manifest-only jars.
                    if ( !name.equals( META_INF_NAME ) && !name.equals( META_INF_NAME + '/' ) && !name.equals(
                        INDEX_NAME ) && !name.equals( MANIFEST_NAME ) )
                    {
                        if ( ze.isDirectory() )
                        {
                            dirSet.add( name );
                        }
                        else if ( !name.contains( "/" ) )
                        {
View Full Code Here

                zf = new ZipFile( file, "utf-8" );
                Enumeration<ZipEntry> entries = zf.getEntries();
                HashSet<String> dirSet = new HashSet<String>();
                while ( entries.hasMoreElements() )
                {
                    ZipEntry ze = entries.nextElement();
                    String name = ze.getName();
                    // avoid index for manifest-only jars.
                    if ( !name.equals( META_INF_NAME ) && !name.equals( META_INF_NAME + '/' ) && !name.equals(
                        INDEX_NAME ) && !name.equals( MANIFEST_NAME ) )
                    {
                        if ( ze.isDirectory() )
                        {
                            dirSet.add( name );
                        }
                        else if ( !name.contains( "/" ) )
                        {
View Full Code Here

TOP

Related Classes of org.codehaus.plexus.archiver.zip.ZipEntry

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.