Пример #1
0
 protected LogoDescriptor computeLogo(FlavorDescriptor flavor, List<String> flavors) {
   if (flavor != null) {
     LogoDescriptor localLogo = flavor.getLogo();
     if (localLogo == null) {
       String extendsFlavorName = flavor.getExtendsFlavor();
       if (!StringUtils.isBlank(extendsFlavorName)) {
         if (flavors.contains(extendsFlavorName)) {
           // cyclic dependency => abort
           log.error("Cyclic dependency detected in flavor '" + flavor.getName() + "' hierarchy");
           return null;
         } else {
           // retrieved the extended logo
           flavors.add(flavor.getName());
           FlavorDescriptor extendedFlavor = getFlavor(extendsFlavorName);
           if (extendedFlavor != null) {
             localLogo = computeLogo(extendedFlavor, flavors);
           } else {
             log.warn("Extended flavor '" + extendsFlavorName + "' not found");
           }
         }
       }
     }
     return localLogo;
   }
   return null;
 }
Пример #2
0
 @Override
 public LogoDescriptor getLogo(String flavorName) {
   FlavorDescriptor flavor = getFlavor(flavorName);
   if (flavor != null) {
     return flavor.getLogo();
   }
   return null;
 }