Exemple #1
0
 protected boolean matchSttingsValueWithInfrastrucutreFile(
     Setting<String> entry, InfrastructureFileDescriptor f) {
   if (entry == null || entry.getDefaultValue() == null) {
     return false;
   }
   return entry.getDefaultValue().equals(f.getDefaultFullPath())
       || entry.getDefaultValue().equals("file://" + f.getDefaultFullPath());
 }
Exemple #2
0
  protected String getFiles(List<InfrastructureFileDescriptor> files) {
    StringBuilder sb = new StringBuilder();
    Set<Map.Entry<String, Setting<String>>> defs = Defaults.getDefaults().entrySet();
    Collections.sort(
        files,
        new Comparator<InfrastructureFileDescriptor>() {

          @Override
          public int compare(InfrastructureFileDescriptor o1, InfrastructureFileDescriptor o2) {
            return o1.toString().compareTo(o2.toString());
          }
        });
    for (InfrastructureFileDescriptor f : files) {
      String path = expandVariables ? f.getFullPath() : f.toString();
      String modified = "";
      String fGetFullPath = removeFileProtocol(f.getFullPath());
      String fGetDefaultFullPath = removeFileProtocol(f.getDefaultFullPath());
      if (!fGetFullPath.equals(fGetDefaultFullPath) && expandVariables) {
        modified = getFormatter().getBold("[" + Translator.R("BUTmodified") + "] ");
      }
      String controlledBy = "";
      for (Map.Entry<String, Setting<String>> entry : defs) {
        if (matchSttingsValueWithInfrastrucutreFile(entry.getValue(), f)) {
          controlledBy =
              " " + Translator.R("BUTControlledBy", getFormatter().getBold(entry.getKey()));

          break;
        }
      }
      sb.append(getFormatter().getOption(path, modified + f.getDescription() + controlledBy));
    }
    return formatter.wrapParagraph(sb.toString());
  }