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

liquibase.parser.core.xml.ClassLoaderXsdStreamResolver Maven / Gradle / Ivy

There is a newer version: 3.6.2.5.inovus
Show newest version
package liquibase.parser.core.xml;

import liquibase.logging.LogService;
import liquibase.logging.LogType;
import liquibase.logging.Logger;

import java.io.InputStream;

public class ClassLoaderXsdStreamResolver extends XsdStreamResolver {

    private static final Logger LOGGER = LogService.getLog(ClassLoaderXsdStreamResolver.class);

    @Override
    public InputStream getResourceAsStream(String xsdFile) {
        LOGGER.debug(LogType.LOG, "Trying to load resource from class classloader");

        InputStream resourceAsStream = this.getClass().getClassLoader().getResourceAsStream(xsdFile);
        if(resourceAsStream == null){
            LOGGER.debug(LogType.LOG, "Failed to load resource from class classloader");
            return getSuccessorValue(xsdFile);
        }
        return resourceAsStream;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy