public void processFiles(List<FileSource> fileSources){
		for (Iterator <FileSource> iterator = fileSources.iterator(); iterator.hasNext();) {
			FileSource fileSource = iterator.next();
			List<FileInformation> files = fileSource.getFiles();
			List<FileInformation> filesWithoutMatch = new ArrayList<FileInformation>();
			log.log(Level.TRACE, "Examining filesource:" + fileSource.getInputFilepath());
			
			try{
				  // Create file for the report.
				  FileWriter fstream = new FileWriter(fileSource.getOutputFilepath()+"report");
				  BufferedWriter out = new BufferedWriter(fstream);
				  
				  out.write("Extraction report" + System.getProperty("line.separator"));
				  
				  List<RegExpDescritor> regExps = fileSource.getRegExp();
				  
				  
			for (Iterator <RegExpDescritor> regExpIterator = regExps.iterator(); regExpIterator
				.hasNext();) {
				
				String regularExpression = regExpIterator.next().getRegExp();
				int match = 0;
				int total = 0;
				
				out.write(" Using regexp: " + regularExpression  + System.getProperty("line.separator") );
				
				for (Iterator<FileInformation> fileInformationIterator = files.iterator(); fileInformationIterator.hasNext();) {
					FileInformation file = fileInformationIterator.next();
					System.out.println(total);
					String text = null;

					if (file.getInputFilename().matches(".*docx{0,1}")){
						text = WordReader.getTextContent(fileSource.getInputFilepath().concat(file.getInputFilename()));
					}
								
					if (file.getInputFilename().matches(".*html{0,1}")){
						text = HTMLReader.getTextContent(fileSource.getInputFilepath().concat(file.getInputFilename()));
					}
					
					if (file.getInputFilename().matches(".*pdf")){
						text = PDFReader.getPDFContent(fileSource.getInputFilepath().concat(file.getInputFilename()));
					}
					
					
					if (text!= null && processFile(text, 
							fileSource.getOutputFilepath().concat(file.getOutputFilename()),
							regularExpression)){
						out.write ("  " + file.getInputFilename() + ": " + System.getProperty("line.separator"));
						match++;
					}else{
						out.write ("  " + file.getInputFilename() + ": no match found." + System.getProperty("line.separator") );
						filesWithoutMatch.add(file);
					}
					
			
					total++;
				}

				out.write("Matches: " + match + " total: " + total + System.getProperty("line.separator"));
				files = filesWithoutMatch;
				filesWithoutMatch = new ArrayList<FileInformation>();
				
			}
			//Close the output stream
				out.close();
				
			}catch (Exception e){//Catch exception if any
				log.log(Level.ERROR,"Problem writing to report file. Error: " + e.getMessage());
				
			}
			
			
		}
	}