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>
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 aFile
Comparator
used to sort the listed files frompluginsRoot
.void
setFilter(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 aFile
Comparator
used 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:PluginRepository
List all plugin paths.- Specified by:
getPluginPaths
in interfacePluginRepository
- 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 interfacePluginRepository
- Parameters:
pluginPath
- the plugin path- Returns:
- true if deleted
-
-