Package org.pf4j

Class BasePluginRepository

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.util.Comparator<java.io.File> comparator  
      protected java.io.FileFilter filter  
      protected java.nio.file.Path pluginsRoot  
    • Constructor Summary

      Constructors 
      Constructor Description
      BasePluginRepository​(java.nio.file.Path pluginsRoot)  
      BasePluginRepository​(java.nio.file.Path pluginsRoot, java.io.FileFilter filter)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean deletePluginPath​(java.nio.file.Path pluginPath)
      Removes a plugin from the repository.
      java.util.List<java.nio.file.Path> getPluginPaths()
      List all plugin paths.
      void setComparator​(java.util.Comparator<java.io.File> comparator)
      Set a File Comparator used to sort the listed files from pluginsRoot.
      void setFilter​(java.io.FileFilter filter)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • pluginsRoot

        protected final java.nio.file.Path pluginsRoot
      • filter

        protected java.io.FileFilter filter
      • comparator

        protected java.util.Comparator<java.io.File> comparator
    • Constructor Detail

      • BasePluginRepository

        public BasePluginRepository​(java.nio.file.Path pluginsRoot)
      • BasePluginRepository

        public BasePluginRepository​(java.nio.file.Path pluginsRoot,
                                    java.io.FileFilter filter)
    • Method Detail

      • setFilter

        public void setFilter​(java.io.FileFilter filter)
      • setComparator

        public void setComparator​(java.util.Comparator<java.io.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 java.util.List<java.nio.file.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​(java.nio.file.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