log.error("prefered: "+ prefered);
    public String getImagefileInfix(String imagefilename) {      String returnedurl=null;      String [] strs = adminsweblanguage.getAvailableLanguages();      log.error("Strs.size: "+strs.length);      int index = currentadminpreference.getPreferedLanguage();      log.error("Index: "+index);      String prefered = strs[index];      log.error("prefered: "+ prefered);      prefered = prefered.toLowerCase();      String secondary = adminsweblanguage.getAvailableLanguages()[currentadminpreference.getSecondaryLanguage()]                                           .toLowerCase();      String imagefile = imagefilename.substring(0,imagefilename.lastIndexOf('.'));      String theme     = currentadminpreference.getTheme().toLowerCase();      String postfix   = imagefilename.substring(imagefilename.lastIndexOf('.')+1);      String preferedthemefilename = "/" + globalconfiguration .getImagesPath()+"/"                                + imagefile + "." + theme + "." + prefered + "." + postfix;      String secondarythemefilename = "/" + globalconfiguration .getImagesPath()+"/"                                + imagefile + "." + theme + "." + secondary + "." + postfix;      String themefilename =  "/" + globalconfiguration .getImagesPath()+"/"                                + imagefile + "." + theme + "."  + postfix;      String preferedfilename = "/" + globalconfiguration .getImagesPath()+"/"                                + imagefile + "." + prefered + "." + postfix;      String secondaryfilename = "/" + globalconfiguration .getImagesPath()+"/"                                 + imagefile + "." + secondary + "." + postfix;       String preferedthemeurl = globalconfiguration .getBaseUrl() + globalconfiguration .getAdminWebPath()                          + globalconfiguration .getImagesPath()+"/"                          + imagefile + "." + theme + "." + prefered + "." + postfix;      String secondarythemeurl = globalconfiguration .getBaseUrl() + globalconfiguration .getAdminWebPath()                          + globalconfiguration .getImagesPath()+"/"                          + imagefile + "." + theme + "." + secondary + "." + postfix;      String imagethemeurl     = globalconfiguration .getBaseUrl()  + globalconfiguration .getAdminWebPath()                          + globalconfiguration .getImagesPath()+"/"                          + imagefile + "." + theme + "." + postfix;      String preferedurl = globalconfiguration .getBaseUrl() + globalconfiguration .getAdminWebPath()                          + globalconfiguration .getImagesPath()+"/"                          + imagefile + "." + prefered + "." + postfix;      String secondaryurl = globalconfiguration .getBaseUrl() + globalconfiguration .getAdminWebPath()                          + globalconfiguration .getImagesPath()+"/"                          + imagefile + "." + secondary + "." + postfix;      String imageurl     = globalconfiguration .getBaseUrl()  + globalconfiguration .getAdminWebPath()                          + globalconfiguration .getImagesPath()+"/"                          + imagefile + "."  + postfix;      if(this.getClass().getResourceAsStream(preferedthemefilename) != null)        returnedurl = preferedthemeurl;      else{        if(this.getClass().getResourceAsStream(secondarythemefilename) != null)          returnedurl = secondarythemeurl;        else{          if(this.getClass().getResourceAsStream(themefilename) != null)            returnedurl = imagethemeurl;          else{            if(this.getClass().getResourceAsStream(preferedfilename) != null)              returnedurl = preferedurl;            else{              if(this.getClass().getResourceAsStream(secondaryfilename) != null)                 returnedurl = secondaryurl;              else                returnedurl = imageurl;            }          }        }      }      return returnedurl;    }