String (String file) { int ind = -1; for (String ext : EGG_EXTENSIONS) { ind = file.indexOf(ext); if (ind != -1) break; } if (ind != -1) { return StringUtil.toLowerCase(file.substring(0, ind + 4)) + file.substring(ind + 4); } else { return StringUtil.toLowerCase(file); } }