public void extractFieldsFromFiles(WebSite webSite)
			throws FileNotFoundException, JSONException, Exception {
		// File inputDir = new File(this.inputDir);
		File inputDir = new File(ExtractorUtils.getInputDir(webSite));
		checkInputDir(inputDir);
		File outputDir = new File(this.outputDir);
		checkOutputDir(outputDir);

		File[] inputFiles = inputDir.listFiles(new FileFilter() {

			@Override
			public boolean accept(File pathname) {
				if (pathname.getName().startsWith(".")) {
					return false;
				}
				return true;
			}
		});

		for (File f : inputFiles) {
			log.info(String.format("Processing file %s ...", f.toString()));
			try {
				Map<String, String> resultingMap = extractFieldsFromOneFile(f,
						webSite);
				if (resultingMap.size() < 6) {//title, content, start_time, end_time, address, url
					continue;
				}
				saveToFile(resultingMap);
			} catch (Exception e) {
				System.out.println(f.getName());
				e.printStackTrace();
			}
		}
		log.info("All done.");
	}