/**
   * check that all contents of the jar are also in the ZIP and up to date.
   *
   * @param jar jar file containing class files
   * @param zip zip file containing class and other files to distribute
   */
static void checkAllJarInZip( File jar, File zip )
   {
   try
      {
      if ( !jar.exists() )
         {
         err.println( "Warning: missing jar " + jar.toString() );
         return;
         }
      if ( !zip.exists() )
         {
         err.println( "Warning: missing zip " + zip.toString() );
         return;
         }
      ZipFile j = new ZipFile( jar );
      ZipFile z = new ZipFile( zip );

      // loop for each jar entry
      for ( Enumeration<? extends ZipEntry> e = j.entries(); e.hasMoreElements(); )
         {
         final ZipEntry jarEntry = e.nextElement();

         final String elementName = jarEntry.getName();
         // zip won't have matching manifest
         if ( !elementName.startsWith( "META-INF/" ) )
            {
            final ZipEntry zipEntry = z.getEntry( elementName );
            if ( zipEntry == null )
               {
               err.println( "Warning: " + zip.toString() + "/" + elementName + " missing" );
               }
            else if ( zipEntry.getSize() != jarEntry.getSize() )
               {
               err.println( "Warning: " + zip.toString() + "/" + elementName + " size mismatch "
                            + ( zipEntry.getSize() - jarEntry.getSize() ) );
               }
            // we can't do anything with timestamps since zip matches the corresponding element,
            // where jar is the time the element was added to the jar, i.e. jar create time.
            }
         }// end for
      j.close();
      z.close();
      }
   catch ( IOException e )
      {
      e.printStackTrace( System.err );
      err.println( "jar or zip i/o problem" );
      }
   }