net.sourceforge.cruisecontrol
Class BuildStatus

java.lang.Object
  extended bynet.sourceforge.cruisecontrol.BuildStatus

public class BuildStatus
extends java.lang.Object

This class has the logic to determine current build status message.

Note the use of the READ_*_LINES constants for the maxReadLines parameter:

You can always pass a number to get a specific number of lines.

Author:
Jeff Jensen

Field Summary
static int READ_ALL_LINES
          Constant meaning to read all lines from the build status file.
static int READ_ONLY_STATUS_LINES
          Constant meaning to read only the project status and time lines from the build status file.
 
Constructor Summary
protected BuildStatus()
           
 
Method Summary
static java.lang.String getStatusHtml(boolean isSingleProject, java.lang.String dir, java.lang.String projectName, java.lang.String statusFileName, int maxReadLines)
          Generate the current build status string formatted for HTML.
static java.lang.String getStatusPlain(boolean isSingleProject, java.lang.String dir, java.lang.String projectName, java.lang.String statusFileName, int maxReadLines)
          Generate the current build status string formatted for plain text.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

READ_ALL_LINES

public static final int READ_ALL_LINES
Constant meaning to read all lines from the build status file.

See Also:
Constant Field Values

READ_ONLY_STATUS_LINES

public static final int READ_ONLY_STATUS_LINES
Constant meaning to read only the project status and time lines from the build status file.

See Also:
Constant Field Values
Constructor Detail

BuildStatus

protected BuildStatus()
Method Detail

getStatusPlain

public static java.lang.String getStatusPlain(boolean isSingleProject,
                                              java.lang.String dir,
                                              java.lang.String projectName,
                                              java.lang.String statusFileName,
                                              int maxReadLines)
Generate the current build status string formatted for plain text.

Parameters:
isSingleProject - Specify true if this is a single project config, or false if it is a multi project config.
dir - The dir containing the build status file.
projectName - The name of the project to get the build status for.
statusFileName - The name of the status file.
maxReadLines - The maximum number of lines to read from the file. Use the READ_ALL_LINES (value of zero) and READ_ONLY_STATUS_LINES (value of 2) constants when applicable.
Returns:
The build status string formatted for plain text usage or the text (build status file not found) if the status file cannot be not found.

getStatusHtml

public static java.lang.String getStatusHtml(boolean isSingleProject,
                                             java.lang.String dir,
                                             java.lang.String projectName,
                                             java.lang.String statusFileName,
                                             int maxReadLines)
Generate the current build status string formatted for HTML.

Parameters:
isSingleProject - Specify true if this is a single project config, or false if it is a multi project config.
dir - The dir containing the build status file.
projectName - The name of the project to get the build status for.
statusFileName - The name of the status file.
maxReadLines - The maximum number of lines to read from the file. Use the READ_ALL_LINES (value of zero) and READ_ONLY_STATUS_LINES (value of 2) constants when applicable.
Returns:
The build status string formatted for plain text usage or the text (build status file not found) if the status file cannot be not found.