private byte[] getResourceFromClasspath(String name) throws IOException, NotFoundException {
// Get resource URL
URL resourceUrl = getClass().getClassLoader().getResource(name);
if (resourceUrl == null) {
throw new NotFoundException("Resource " + name + " not found in class-path");
}
// Get input stream and read the bytes
URLConnection uc = (URLConnection)resourceUrl.openConnection();
InputStream is = uc.getInputStream();