This commit is contained in:
Him188 2020-08-27 22:30:39 +08:00
parent 5665bde12c
commit 16242c9a93

View File

@ -149,10 +149,13 @@ public interface FilePluginLoader<P : Plugin, D : PluginDescription> : PluginLoa
* @see FilePluginLoader
*/
public abstract class AbstractFilePluginLoader<P : Plugin, D : PluginDescription>(
/**
* 所支持的插件文件后缀, '.'. [JarPluginLoader] ".jar"
*/
public override val fileSuffix: String
) : FilePluginLoader<P, D> {
private fun pluginsFilesSequence(): Sequence<File> =
PluginManager.pluginsPath.toFile().walk()
PluginManager.pluginsFolder.listFiles().orEmpty().asSequence()
.filter { it.isFile && it.name.endsWith(fileSuffix, ignoreCase = true) }
/**