Search in sources :

Example 1 with WhitelistDirectoryService

use of io.jpom.service.WhitelistDirectoryService in project Jpom by dromara.

the class NodeProjectInfoModel method repairWhitelist.

private void repairWhitelist() {
    if (StrUtil.isEmpty(whitelistDirectory) && StrUtil.isEmpty(lib)) {
        throw new JpomRuntimeException("当前项目lib数据异常");
    }
    if (StrUtil.isNotEmpty(whitelistDirectory)) {
        return;
    }
    WhitelistDirectoryService whitelistDirectoryService = SpringUtil.getBean(WhitelistDirectoryService.class);
    List<String> project = whitelistDirectoryService.getWhitelist().getProject();
    for (String path : project) {
        if (lib.startsWith(path)) {
            String itemWhitelistDirectory = lib.substring(0, path.length());
            lib = lib.substring(path.length());
            setWhitelistDirectory(itemWhitelistDirectory);
            setLib(lib);
        }
    }
}
Also used : JpomRuntimeException(io.jpom.system.JpomRuntimeException) WhitelistDirectoryService(io.jpom.service.WhitelistDirectoryService)

Aggregations

WhitelistDirectoryService (io.jpom.service.WhitelistDirectoryService)1 JpomRuntimeException (io.jpom.system.JpomRuntimeException)1