class ClassPathStaticRepository implements StaticRepository {
    String location;
    String locationDebug;
    ClassLoader classLoader;


    /**
     * 构建函数
     *
     * @param location 位置
     */
    public ClassPathStaticRepository(String location) {
        this(AppClassLoader.global(), location);
    }

    public ClassPathStaticRepository(ClassLoader classLoader, String location) {
        this.classLoader = classLoader;

        setLocation(location);
    }

    /**
     * @param location 位置
     */
    protected void setLocation(String location) {<FILL_FUNCTION_BODY>}

    /**
     * @param relativePath 例：demo/file.htm （没有'/'开头）
     * */
    @Override
    public URL find(String relativePath) throws Exception {
        if (locationDebug != null) {
            URI uri = URI.create(locationDebug + relativePath);
            File file = new File(uri);

            if (file.exists()) {
                return uri.toURL();
            }
        }

        return ResourceUtil.getResource(classLoader, location + relativePath);
    }
}

        if (location == null) {
            return;
        }

        // 去掉头尾的 "/"
        if (location.startsWith("/")) {
            location = location.substring(1);
        }

        //尾部加上 "/"（确保'/'结尾）
        if (location.endsWith("/") == false) {
            location = location + "/";
        }

        this.location = location;

        if (Solon.cfg().isDebugMode()) {
            URL rooturi = ResourceUtil.getResource(classLoader, "/");

            if (rooturi != null) {
                String rootdir = rooturi.toString()
                        .replace("target/classes/", "");

                if (rootdir.startsWith("file:")) {
                    this.locationDebug = rootdir + "src/main/resources/" + location;
                }
            }
        }
    
<no_super_class>