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

com.smartnews.jpa_entity_generator.util.ResourceReader Maven / Gradle / Ivy

There is a newer version: 0.99.9
Show newest version
package com.smartnews.jpa_entity_generator.util;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;

/**
 * Utility to reader classpath resources.
 */
public class ResourceReader {

    private ResourceReader() {
    }

    public static InputStream getResourceAsStream(String path) throws IOException {
        InputStream classPathResource = ResourceReader.class.getClassLoader().getResourceAsStream(path);
        if (classPathResource != null) {
            return classPathResource;
        }
        InputStream fileResource = new FileInputStream(new File(path));
        return fileResource;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy