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

io.github.stylesmile.knife4j.StaticFileUtil Maven / Gradle / Ivy

The newest version!
package io.github.stylesmile.knife4j;

import io.github.stylesmile.filter.FilterManager;
import io.github.stylesmile.staticfile.ResourceUtil;
import io.github.stylesmile.staticfile.StaticFileFilter;
import io.github.stylesmile.staticfile.StaticFilePluginImp;

import java.net.URL;
import java.util.List;

public class StaticFileUtil {
    public static final String DEFAULT_STATIC_LOCATION = "static/";
    public void init() {
        // 扫描静态文件
//        StaticFilePluginImp.findFile(DEFAULT_STATIC_LOCATION);
//        List urlList1 = ResourceUtil.getAllResourceFiles("img/");
//        List urlList2 = ResourceUtil.getAllResourceFiles("webjars/");
//        List urlList3 = ResourceUtil.getAllResourceFiles("doc.html");
//        urlList1.addAll(urlList2);
//        urlList1.addAll(urlList3);
//        if (urlList1.size() == 0) {
//            return;
//        }
//        findFile(urlList1.get(0).toString().substring(6));
//        FilterManager.addFilter(StaticFileFilter.class);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy