public static void listFilesForFolder(File folder, Map<String, URL>trainingFiles, String path,String category){
		 	
		 	for (File fileEntry : folder.listFiles()) {
		        if (fileEntry.isDirectory()) {
		            listFilesForFolder(fileEntry,trainingFiles, path,category);
		        } else {
		        	//read the correct path
		            trainingFiles.put(category, NaiveBayesExample.class.getResource(fileEntry.getPath().replace(path, "")));
		        }
		    }
		}