com.atlassian.bamboo.build.logger
Class BuildLogUtils

java.lang.Object
  extended by com.atlassian.bamboo.build.logger.BuildLogUtils

public class BuildLogUtils
extends java.lang.Object

Provides text parsing utilities for writing and reading build log files.


Field Summary
protected static java.lang.String SEPERATOR
           
 
Method Summary
static LogEntry convertToLogEntry(java.lang.String fileEntry)
          Converts a line from a file back into a LogEntry object
static LogEntry convertToLogEntry(java.lang.String fileEntry, java.text.SimpleDateFormat dateFormat)
          Converts a line from a file back into a LogEntry object
static java.lang.String convertToLogFileEntry(LogEntry logEntry)
          Convert the specified LogEntry object into a string to be written to a log file
static java.io.File getLogFileDirectory(java.lang.String planKey)
          Retrieves the standard location for a builds log files based on the bamboo home
static java.lang.String getLogFileName(java.lang.String planKey, int buildNumber)
          Returns the standard naming convention for log files
static void sendFileThroughLogger(java.io.File file, BuildLogger buildLogger)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SEPERATOR

protected static final java.lang.String SEPERATOR
See Also:
Constant Field Values
Method Detail

convertToLogFileEntry

public static java.lang.String convertToLogFileEntry(@NotNull
                                                     LogEntry logEntry)
Convert the specified LogEntry object into a string to be written to a log file

Parameters:
logEntry - the LogEntry to be written
Returns:
String file entry, should never be empty

convertToLogEntry

public static LogEntry convertToLogEntry(java.lang.String fileEntry)
Converts a line from a file back into a LogEntry object

Parameters:
fileEntry - to be converted
Returns:
the resulting LogEntry object, will return null if fileEntry is empty

convertToLogEntry

@Nullable
public static LogEntry convertToLogEntry(java.lang.String fileEntry,
                                                  @NotNull
                                                  java.text.SimpleDateFormat dateFormat)
Converts a line from a file back into a LogEntry object

Parameters:
fileEntry - to be converted
dateFormat -
Returns:
the resulting LogEntry object, will return null if fileEntry is empty

getLogFileDirectory

public static java.io.File getLogFileDirectory(java.lang.String planKey)
Retrieves the standard location for a builds log files based on the bamboo home

Parameters:
planKey - for this file
Returns:
Directory(File) for log files for that build

getLogFileName

public static java.lang.String getLogFileName(java.lang.String planKey,
                                              int buildNumber)
Returns the standard naming convention for log files

Parameters:
planKey - for the logs file
buildNumber - for the log file
Returns:
String file name.

sendFileThroughLogger

public static void sendFileThroughLogger(@NotNull
                                         java.io.File file,
                                         @NotNull
                                         BuildLogger buildLogger)
                                  throws java.io.IOException
Throws:
java.io.IOException


Copyright © 2011 Atlassian. All Rights Reserved.