logger.info("Writing avatar to resource " + file.getPath());
// Write out the avatar configuration to a byte avatar.
ByteArrayOutputStream out = new ByteArrayOutputStream();
character.saveConfiguration(out);
out.close();
// Then write out the XML to the local repository. Update the avatar
// to point to this local avatar resource
file.put(out.toByteArray());