private static void indexDirectory(IndexWriter writer, File dir) {
		
		//ȡǰļĿ¼µļļ
		File[] files = dir.listFiles();
		/**
		 * File[]
		 * ļУִеݹ
		 * txtıĵִindexfile()
		 */
		for (int i = 0; i < files.length; i++) {
			File f = files[i];
			//·ʾļǷһĿ¼
			//¼Ŀ¼ ݹ
			if (f.isDirectory()) {
				indexDirectory(writer, f);
			} 
			//String endsWith()
			//ʵļĲ
			else if (f.getName().endsWith(".txt")) {
				indexFile(writer, f);
			}
		}
	}