
I would like to find jar file name from multiple set of jar files where the given class name�com.rational.ft.util.debug� is there

Java find jar file name from multiple set of jar files
import java.io.*;
import java.util.*;
class OnlyExt implements FilenameFilter{
String ext;
public OnlyExt(String ext){
this.ext="." + ext;
}
public boolean accept(File dir,String name){
return name.endsWith(ext);
}
}
class FindJar
{
public static void main(String[] args)
{
ArrayList list=new ArrayList();
FilenameFilter ff = new OnlyExt("jar");
File folder = new File("C:/");
File[] files = folder.listFiles(ff);
for(int i=0;i<files.length;i++){
list.add(files[i].getName());
}
if(list.contains("examples.jar")){
System.out.println("Jar file exist");
}
else{
System.out.println("Jar file does not exist");
}
}
}
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.