import java.io.File;
import java.util.ArrayList;
import java.util.List;

import org.apache.commons.lang3.StringUtils;


public class Test {

	public static void main(String[] args) {
		String path = "D:\\code\\app-version\\iamberry-common-parent\\iamberry-wechat-service\\src\\main\\java\\com\\iamberry\\wechat\\service\\mapper";
		
		File file = new File(path);
		list(file);
	}
	
	public static void list(File file) {
		if (file.isDirectory()) {
			File[] files = null;
			files = file.listFiles();
			for (File file2 : files) {
				list(file2);
			}
		} else {
			if (file.getName().endsWith(".xml")) {
				System.out.println("<mapper resource=\"classpath:" + getType(file.getAbsolutePath()) + "\"/>");
			}
		}
	}
	
	public static String getType(String s) {
		s =  StringUtils.replace(StringUtils.substring(s, s.indexOf("java") + 5, s.length()), File.separator, ".");
		return s;
	}
	
	public static String getName(String s) {
		return StringUtils.split(s, ".")[0];
	}
}
