All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.zodiac.plugin.util.ScanUtil Maven / Gradle / Ivy

There is a newer version: 1.6.8
Show newest version
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);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy