com.pmease.quickbuild.util
Class System

java.lang.Object
  extended bycom.pmease.quickbuild.util.System

public class System
extends java.lang.Object


Constructor Summary
System()
           
 
Method Summary
 java.text.SimpleDateFormat createDateFormat(java.lang.String dateFormat)
          OGNL: Create a date format object with specified format string.
 java.util.regex.Matcher createMatcher(java.lang.String pattern, java.lang.String text)
          OGNL: Create a matcher object with specified pattern and text.
 java.util.regex.Pattern createPattern(java.lang.String pattern)
          OGNL: Create a Java regular expression pattern.
 int execute(java.lang.String command)
          OGNL: Execute specified command and get the result code.
 Calendar getCalendar()
          OGNL: Get calendar object.
 java.lang.String getInstallDir()
          OGNL: Get installation directory of this system.
 SystemSetting getSetting()
          OGNL: Get system settings
 java.lang.String getUrl()
          OGNL: Get accessing URL for this system
 java.lang.String readFile(java.lang.String filePath)
          OGNL: Read content of specified file.
 java.lang.String readFile(java.lang.String filePath, java.lang.String pattern, int range)
          OGNL: Read partial content of specified file.
 java.lang.String readFileAsHtml(java.lang.String filePath)
          OGNL: Read content of specified file and convert end of line character to <br> which is suitable for html rendering.
 java.lang.String readFileAsHtml(java.lang.String filePath, java.lang.String pattern, int range)
          OGNL: Read partial content of specified file and convert end of line character to <br>.
 java.lang.String readOutput(java.lang.String command)
          OGNL: Execute specified command and get the output.
 java.lang.String readUrl(java.lang.String url, java.lang.String user, java.lang.String password)
          OGNL: Read content from specified URL.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

System

public System()
Method Detail

getUrl

public java.lang.String getUrl()
OGNL: Get accessing URL for this system

Returns:

getInstallDir

public java.lang.String getInstallDir()
OGNL: Get installation directory of this system.

Returns:

getCalendar

public Calendar getCalendar()
OGNL: Get calendar object.

Returns:

getSetting

public SystemSetting getSetting()
OGNL: Get system settings

Returns:

readFileAsHtml

public java.lang.String readFileAsHtml(java.lang.String filePath)
OGNL: Read content of specified file and convert end of line character to <br> which is suitable for html rendering.

Parameters:
filePath -
Returns:

readFileAsHtml

public java.lang.String readFileAsHtml(java.lang.String filePath,
                                       java.lang.String pattern,
                                       int range)
OGNL: Read partial content of specified file and convert end of line character to <br>. This partial content includes lines matching specified regular expression pattern, and fixed number of lines arround the matching line. The fixed number is specified by range parameter. If range is specified as 1, only matching line will be returned.

Parameters:
filePath -
pattern -
range -
Returns:

readFile

public java.lang.String readFile(java.lang.String filePath)
OGNL: Read content of specified file. Multiple lines are separated by line terminators.

Parameters:
filePath -
Returns:

readFile

public java.lang.String readFile(java.lang.String filePath,
                                 java.lang.String pattern,
                                 int range)
OGNL: Read partial content of specified file. This partial content includes lines matching specified regular expression pattern, and fixed number of lines arround the matching line. The fixed number is specified by range parameter. If range is specified as 1, only matching line will be returned. Multiple lines are separated by line terminators.

Parameters:
filePath -
pattern -
range -
Returns:

readUrl

public java.lang.String readUrl(java.lang.String url,
                                java.lang.String user,
                                java.lang.String password)
OGNL: Read content from specified URL. Multiple lines are separated by line terminators.

Parameters:
url - specify the URL to read content from.
user - if not blank, it will be encoded as user name for basic authentication
password - encoded as password for basic authentication if user is not blank.
Returns:

readOutput

public java.lang.String readOutput(java.lang.String command)
OGNL: Execute specified command and get the output. Multiple lines of output are separated by line terminators.

Parameters:
command - command to execute.
Returns:
output of the command..

createPattern

public java.util.regex.Pattern createPattern(java.lang.String pattern)
OGNL: Create a Java regular expression pattern.

Parameters:
pattern -
Returns:

createMatcher

public java.util.regex.Matcher createMatcher(java.lang.String pattern,
                                             java.lang.String text)
OGNL: Create a matcher object with specified pattern and text.

Parameters:
pattern -
text -
Returns:
null if pattern not matches with specified text.

createDateFormat

public java.text.SimpleDateFormat createDateFormat(java.lang.String dateFormat)
OGNL: Create a date format object with specified format string.

Parameters:
dateFormat -
Returns:

execute

public int execute(java.lang.String command)
OGNL: Execute specified command and get the result code.

Parameters:
command -
Returns:
result code of the command.


Copyright © 2005 PMEase Inc. All Rights Reserved.