NTFile content = getGadgetContent();
content.setContentResource(new Resource(GADGET_MIME_TYPE, encoding, bytes));
}
public String getSource() throws Exception {
NTFile content = getGadgetContent();
Resource res = content.getContentResource();
String encoding = res.getEncoding();
byte[] bytes = res.getData();
return new String(bytes, encoding);
}