ITeye博客

Url

majm · 2011-02-14 18:33 · 编程语言 · Markdown

..\adaptor\clientadaptor\cgp\V100R002C21B021\mml\en_US\

D:\CDE\omu\workspace1\client/..//adaptor//clientadaptor\cgp\v100r002c21b021\

public static void main(String args) {

// String url1= "..\adaptor\clientadaptor\cgp\V100R002C21B021\mml\en_US"; // String url2= "D:\CDE\omu\workspace1\client/..//adaptor//clientadaptor\cgp\v100r002c21b021"; String url3= "D:/CDE/omu/workspace1/adaptor/clientadaptor/cgp/V100R002C21B021/";

// File filePath = new File("D:\CDE\omu\workspace1\client"); // String strarray =filePath.list(); // ArrayList arrayList = new ArrayList(); // arrayList.add(strarray); // System.out.println(arrayList.toString()); // // String str = new String("D:\CDE\omu\workspace1\client"); // // Arrays.toString(str.split("\\"));

	File filePath = new File(url3);
	File fileArray = null;

// File fileArray1 = filePath.listFiles(); // File fileArray2 = fileArray1.listFiles(); // File fileArray3 = fileArray2.listFiles(); // fileArray3.listFiles(filter) // filePath.listFiles(new FileFilter()); // filePath.listFiles(new Dirfilter("en_US")); while (filePath.isDirectory()) { fileArray=filePath.listFiles(); filePath = fileArray; } File fileArray4 = filePath.listFiles(new Dirfilter("macro.ini")); System.out.println(); } }

class Dirfilter implements FilenameFilter{

private Pattern pattern;

public Dirfilter(String regex) {
	pattern = Pattern.compile(regex);
}

@Override
public boolean accept(File dir, String name) {
	return pattern.matcher(name).matches();
}

}

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。