org.zodiac.plugin.util.ScanUtil Maven / Gradle / Ivy
package org.zodiac.plugin.util;
import java.io.IOException;
import java.util.Set;
import java.util.jar.JarFile;
import org.pf4j.PluginWrapper;
import org.zodiac.commons.util.Scans;
public abstract class ScanUtil extends Scans {
private ScanUtil() {
}
/**
* 扫描jar包中的类。
*
* @param basePackage
* 包名
* @param pluginWrapper
* jar的PluginWrapper
* @return 类全路径
* @throws IOException
* 扫描异常
*/
public static Set scanClassPackageName(String basePackage, PluginWrapper pluginWrapper) throws IOException {
String pluginPath = pluginWrapper.getPluginPath().toString();
JarFile jarFile = new JarFile(pluginPath);
return scanClassPackageName(basePackage, jarFile, true);
}
}