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

com.networknt.codegen.handler.CodegenResourceProvider Maven / Gradle / Ivy

There is a newer version: 2.1.37
Show newest version
package com.networknt.codegen.handler;

import com.networknt.resource.PathResourceProvider;
import io.undertow.server.handlers.resource.PathResourceManager;
import io.undertow.server.handlers.resource.ResourceManager;

import java.io.File;
import java.net.URL;

/**
 * @author Nicholas Azar
 * Created on April 22, 2018
 */
public class CodegenResourceProvider implements PathResourceProvider {
    @Override
    public String getPath() {
        return "/view";
    }

    @Override
    public Boolean isPrefixPath() {
        return true;
    }

    @Override
    public ResourceManager getResourceManager() {
        URL resourceDir = CodegenResourceProvider.class.getResource("/view");
        if (resourceDir != null) {
            return new PathResourceManager(new File(resourceDir.getFile()).toPath());
        }
        return null;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy