public <T> Collection<T> loadFromDir(File file, Class<T> type) {
    ArrayList<T> list = new ArrayList<>();
    try {
      List<Class<T>> implementationClasses = getInterfaceImplementations(type, file);

      for (Class<?> class1 : implementationClasses) {
        try {
          T classInstance = (T) class1.newInstance();
          list.add(classInstance);
        } catch (Throwable e) {
          LOGGER.error(String.format("Error creating class %s from file %s: %s", class1.getName(), file, e.getMessage()));
        }
      }
    } catch (Throwable e) {
      LOGGER.error(String.format("Error loading class type %s from file %s: %s", type, file, e.getMessage()));
    }
    return list;
  }
Load classes (interface implementation) from directory.

@param <T>
@param dir  dir with classes, zip or jar's
@param type interface to load
@return
olv-core/src/main/java/pl/otros/logview/api/BaseLoader.java