Set avatar for ThingTemplate in custom extension?
Hi,
I want to set the avatar for a ThingTemplate, and all implementing Things, in my custom extension. There's not much on this in the Extension Development Guide (v4).
Currently, I'm attempting to use SetAvatar in the initializeThing() method of my extensions ThingTemplate.
@Override
public void initializeThing() throws Exception {
super.initializeThing();
InputStream stream = this.getClass().getClassLoader().getResourceAsStream(resourceName);
if (stream == null) {
throw new Exception("Cannot get resource \"" + resourceName + "\" from Jar file.");
}
byte[] content = Base64.encode(IOUtils.toByteArray(stream));
this.setAvatar(content);
}
resourceName is the name of a PNG image located in the root of my extension project directory.
Is their annotation or aspect I should be setting?
Thanks,
Shane

