private boolean checkURLRecursively(int indent,URL url) throws IOException {
  verboseMessage("Comparing with " + url);
  JarLoader jarloader=new JarLoader(url);
  JarFile j=jarloader.getJarFile();
  Manifest man=j.getManifest();
  if (man != null) {
    Attributes attr=man.getMainAttributes();
    if (attr != null) {
      String title=attr.getValue(Name.SPECIFICATION_TITLE);
      String version=attr.getValue(Name.SPECIFICATION_VERSION);
      String vendor=attr.getValue(Name.SPECIFICATION_VENDOR);
      String implTitle=attr.getValue(Name.IMPLEMENTATION_TITLE);
      String implVersion=attr.getValue(Name.IMPLEMENTATION_VERSION);
      String implVendor=attr.getValue(Name.IMPLEMENTATION_VENDOR);
      String sealed=attr.getValue(Name.SEALED);
      if (title != null) {
        if (title.equals(targetSpecTitle)) {
          if (version != null) {
            if (version.equals(targetSpecVersion) || isNotOlderThan(version,targetSpecVersion)) {
              verboseMessage("");
              verboseMessage("CONFLICT DETECTED ");
              verboseMessage("Conflicting file:" + url);
              verboseMessage("Installed Version:" + version);
              if (implTitle != null)               verboseMessage("Implementation Title:" + implTitle);
              if (implVersion != null)               verboseMessage("Implementation Version:" + implVersion);
              if (implVendor != null)               verboseMessage("Implementation Vendor:" + implVendor);
              return false;
            }
          }
        }
      }
    }
  }
  boolean result=true;
  URL[] loaderList=jarloader.getClassPath();
  if (loaderList != null) {
    for (int i=0; i < loaderList.length; i++) {
      if (url != null) {
        boolean res=checkURLRecursively(indent + 1,loaderList[i]);
        result=res && result;
      }
    }
  }
  return result;
}

private boolean checkURLRecursively ( int indent , URL url ) throws IOException { verboseMessage ( "Comparing with " + url ) ; JarLoader jarloader = new JarLoader ( url ) ; JarFile j = jarloader . getJarFile ( ) ; Manifest man = j . getManifest ( ) ; if ( man != null ) { Attributes attr = man . getMainAttributes ( ) ; if ( attr != null ) { String title = attr . getValue ( Name . SPECIFICATION_TITLE ) ; String version = attr . getValue ( Name . SPECIFICATION_VERSION ) ; String vendor = attr . getValue ( Name . SPECIFICATION_VENDOR ) ; String implTitle = attr . getValue ( Name . IMPLEMENTATION_TITLE ) ; String implVersion = attr . getValue ( Name . IMPLEMENTATION_VERSION ) ; String implVendor = attr . getValue ( Name . IMPLEMENTATION_VENDOR ) ; String sealed = attr . getValue ( Name . SEALED ) ; if ( title != null ) { if ( title . equals ( targetSpecTitle ) ) { if ( version != null ) { if ( version . equals ( targetSpecVersion ) || isNotOlderThan ( version , targetSpecVersion ) ) { verboseMessage ( "" ) ; verboseMessage ( "CONFLICT DETECTED " ) ; verboseMessage ( "Conflicting file:" + url ) ; verboseMessage ( "Installed Version:" + version ) ; if ( implTitle != null ) verboseMessage ( "Implementation Title:" + implTitle ) ; if ( implVersion != null ) verboseMessage ( "Implementation Version:" + implVersion ) ; if ( implVendor != null ) verboseMessage ( "Implementation Vendor:" + implVendor ) ; return false ; } } } } } } boolean result = true ; URL [ ] loaderList = jarloader . getClassPath ( ) ; if ( loaderList != null ) { for ( int i = 0 ; i < loaderList . length ; i ++ ) { if ( url != null ) { boolean res = checkURLRecursively ( indent + 1 , loaderList [ i ] ) ; result = res && result ; } } } return result ; }
recursively verify that a jar file , and any urls mentioned in its class path , do not conflict with the target jar file .
