try{
boolean failed=false;
Manifest manifest=new Manifest(new FileInputStream(new File(explodedJarPath+File.separator+JarFile.MANIFEST_NAME)));
String depClassPath=manifest.getMainAttributes().getValue(Attributes.Name.CLASS_PATH);
if(depClassPath!=null){
for(StringTokenizer st=new StringTokenizer(depClassPath);st.hasMoreTokens();){
String entry=st.nextToken();
String entryPath=new File(explodedJarPath).getParent()+File.separator+entry;
File bundledOptPkg=new File(entryPath);
if(!bundledOptPkg.isDirectory()){
Manifest bundledManifest=new JarFile(bundledOptPkg).getManifest();
String bundledCP=bundledManifest.getMainAttributes().getValue(Attributes.Name.CLASS_PATH);
if(bundledCP!=null && bundledCP.length()!=0){
failed=true;
result.failed(entry + " contains Class-Path in it's manifest.");
}
}
}
}//if
if(!failed){
result.setStatus(Result.PASSED);
}
}catch(Exception e){
result.failed(e.toString());
}