}
public Avatar getAvatar(String name) {
if (StringUtils.contains(name, '.')) {
File file = new File(avatarDir + name);
if (file.exists()) { return new FileAvatar(file); }
} else {
for (int i = 0; i < typeList.size(); i++) {
StringBuilder sb = new StringBuilder(avatarDir);
sb.append(name).append('.').append(typeList.get(i));
File file = new File(sb.toString());
if (file.exists()) { return new FileAvatar(file); }
}
}
return null;
}