public static List<Class<?>> processDirectory(File directory) {

		ArrayList<Class<?>> classes = new ArrayList<Class<?>>();

		log("Reading Directory '" + directory + "'");
		try {
			// Get the list of the files contained in the package
			String[] files = directory.list();
			for (int i = 0; i < files.length; i++) {
				String fileName = files[i];
				String className = null;

				// we are only interested in .class files
				if (fileName.endsWith(".class")) {
					// removes the .class extension
					className = fileName.substring(0, fileName.length() - 6);
				}

				log("FileName '" + fileName + "'  =>  class '" + className + "'");

				if (className != null) {
					classes.add(loadClass(className));
				}

				// If the file is a directory recursively find class.
				File subdir = new File(directory, fileName);
				if (subdir.isDirectory()) {
					classes.addAll(processDirectory(subdir));
				}

				// if file is a jar file
				if (fileName.endsWith(".jar")) {
					
					classes.addAll(processJarfile(directory.getAbsolutePath() + "/" + fileName));

				}
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
		return classes;
	}