io.github.factoryfx.dom.rest.ClasspathStaticFileAccess Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of domFactoryEditing Show documentation
Show all versions of domFactoryEditing Show documentation
factoryfx dependency injection framework
package io.github.factoryfx.dom.rest;
import java.io.IOException;
import java.io.InputStream;
public class ClasspathStaticFileAccess implements StaticFileAccess {
public byte[] getFile(String path){
try (InputStream inputStream= getClass().getResourceAsStream("/js/"+path)){
return inputStream.readAllBytes();
} catch (IOException e) {
throw new RuntimeException(e);
}
}
}