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 java.lang.Object implements PluginRepository
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Comparator<java.io.File>comparatorprotected java.io.FileFilterfilterprotected java.nio.file.PathpluginsRoot
-
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 booleandeletePluginPath(java.nio.file.Path pluginPath)Removes a plugin from the repository.java.util.List<java.nio.file.Path>getPluginPaths()List all plugin paths.voidsetComparator(java.util.Comparator<java.io.File> comparator)Set aFileComparatorused to sort the listed files frompluginsRoot.voidsetFilter(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 aFileComparatorused to sort the listed files frompluginsRoot. This comparator is used ingetPluginPaths()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 withnull.
-
getPluginPaths
public java.util.List<java.nio.file.Path> getPluginPaths()
Description copied from interface:PluginRepositoryList all plugin paths.- Specified by:
getPluginPathsin interfacePluginRepository- Returns:
- a list with paths
-
deletePluginPath
public boolean deletePluginPath(java.nio.file.Path pluginPath)
Description copied from interface:PluginRepositoryRemoves a plugin from the repository.- Specified by:
deletePluginPathin interfacePluginRepository- Parameters:
pluginPath- the plugin path- Returns:
- true if deleted
-
-