import java.io.*;
public class Jar2Build {
public static void main(String[] args) {
String prefix=".\\lib\\";
String directory="D:\\MyEclipse 6.0\\iaa_changsheng\\lib";
printJar(prefix,directory);
}
private static void printJar(String prefix, String directory) {
StringBuilder sb=new StringBuilder();
File f=new File(directory);
FilenameFilter filter=new JarFileFilter(".jar");
String[] allJarFile=f.list(filter);
for(String s:allJarFile)
sb.append(prefix+s+";");
System.out.println(sb.toString());
}
}
class JarFileFilter implements FilenameFilter{
String filter;
public JarFileFilter(String filter) {
super();
this.filter = filter;
}
public boolean accept(File dir, String name) {
return (name.endsWith(filter));
}
}