Package org.pf4j

Class BasePluginRepository

java.lang.Object
org.pf4j.BasePluginRepository
All Implemented Interfaces:
PluginRepository
Direct Known Subclasses:
DefaultPluginRepository, DevelopmentPluginRepository, JarPluginRepository

public class BasePluginRepository extends Object implements PluginRepository
  • Field Details

  • Constructor Details

    • BasePluginRepository

      public BasePluginRepository(Path pluginsRoot)
    • BasePluginRepository

      public BasePluginRepository(Path pluginsRoot, FileFilter filter)
  • Method Details

    • setFilter

      public void setFilter(FileFilter filter)
    • setComparator

      public void setComparator(Comparator<File> comparator)
      Set a File Comparator used to sort the listed files from pluginsRoot. This comparator is used in getPluginPaths() method. By default is used a file comparator that returns the last modified files first. If you don't want a file comparator, then call this method with null.
    • getPluginPaths

      public List<Path> getPluginPaths()
      Description copied from interface: PluginRepository
      List all plugin paths.
      Specified by:
      getPluginPaths in interface PluginRepository
      Returns:
      a list with paths
    • deletePluginPath

      public boolean deletePluginPath(Path pluginPath)
      Description copied from interface: PluginRepository
      Removes a plugin from the repository.
      Specified by:
      deletePluginPath in interface PluginRepository
      Parameters:
      pluginPath - the plugin path
      Returns:
      true if deleted