private static boolean hasValidJarContent(final InputStream inputStream){
  JarInputStream jarInputStream=null;
  boolean valid=false;
  try {
    jarInputStream=new JarInputStream(inputStream);
    valid=(jarInputStream.getNextJarEntry() != null);
  }
 catch (  IOException ignore) {
  }
 finally {
    try {
      jarInputStream.close();
    }
 catch (    IOException ioex) {
    }
  }
  return valid;
}

private static boolean hasValidJarContent ( final InputStream inputStream ) { JarInputStream jarInputStream = null ; boolean valid = false ; try { jarInputStream = new JarInputStream ( inputStream ) ; valid = ( jarInputStream . getNextJarEntry ( ) != null ) ; } catch ( IOException ignore ) { } finally { try { jarInputStream . close ( ) ; } catch ( IOException ioex ) { } } return valid ; }
peek into the jar data and make sure that it is valid jar content .
