1 37 package net.sourceforge.cruisecontrol.publishers.rss; 38 39 import java.io.File ; 40 41 50 public class CruiseControlFeed extends Feed { 51 52 56 private int projectCount; 57 58 private String projectName; 59 60 63 public CruiseControlFeed(File publishToFile) { 64 super(publishToFile); 65 } 66 67 71 public void incrementProjectCount() { 72 this.projectCount++; 73 } 74 75 79 public int getProjectCount() { 80 return this.projectCount; 81 } 82 83 86 public void setProjectName(String name) { 87 if (isNotEmpty(this.projectName)) { 88 this.projectName = this.projectName + ", " + name; 89 } else { 90 this.projectName = name; 91 } 92 } 93 94 97 public String getProjectName() { 98 return this.projectName; 99 } 100 101 106 public String getDescription() { 107 if (isNotEmpty(super.getDescription())) { 108 return super.getDescription(); 109 } else if (isNotEmpty(this.projectName)) { 110 return "Automated build results for CruiseControl project(s) " + this.projectName; 111 } else { 112 return "Automated build results for CruiseControl."; 113 } 114 } 115 116 121 public String getTitle() { 122 if (isNotEmpty(super.getTitle())) { 123 return super.getTitle(); 124 } else { 125 return "CruiseControl Build Results"; 126 } 127 } 128 129 private static boolean isNotEmpty(String string) { 130 return string != null && string.trim().length() > 0; 131 } 132 } 133 134 135 136 | Popular Tags |