com.smartnews.jpa_entity_generator.util.ResourceReader Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jpa-entity-generator Show documentation
Show all versions of jpa-entity-generator Show documentation
Lombok-wired JPA entity source code generator, Gradle and Maven supported.
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