code: public static Set<Class<?>> getFromDirectory(final ClassLoader loader, final File directory, final String packageName,
                                                   final boolean mapSubPackages) throws ClassNotFoundException {
          final Set<Class<?>> classes = new HashSet<Class<?>>();
          if (directory.exists()) {
              for (final String file : getFileNames(directory, packageName, mapSubPackages)) {
                  if (file.endsWith(".class")) {
                      final String name = stripFilenameExtension(file);
                      final Class<?> clazz = Class.forName(name, true, loader);
                      classes.add(clazz);
                  }
              }
          }
          return classes;
      }
docs: Returns the classes in a package found in a directory
  
  @param loader         the ClassLoader to use
  @param directory      the directory to scan
  @param packageName    the package to scan
  @param mapSubPackages whether to map the sub-packages while scanning
  @return the list of classes
  @throws ClassNotFoundException thrown if a class can not be found