|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.philemonworks.selfdiagnose.DiagnosticTask com.philemonworks.selfdiagnose.check.CheckFileContainsString
public class CheckFileContainsString
CheckFileContainsString is a task that scans a file for at least one occurrence of a String. The file must be character-based and is found as a resource (on the classpath) or a simple file.
<checkfilecontainsstring name="environment.properties" string="smtp.xs4all.nl" /> <checkfilecontainsstring url="${urlvar}" string="smtp.xs4all.nl" />Stores the URL (java.net.URL) of the file into the (optional) specified variable.
Field Summary |
---|
Fields inherited from class com.philemonworks.selfdiagnose.DiagnosticTask |
---|
comment, PARAMETER_COMMENT, PARAMETER_REPORT, PARAMETER_VARIABLE, reportResults, requestor, variableName |
Constructor Summary | |
---|---|
CheckFileContainsString()
|
Method Summary | |
---|---|
String |
getConfiguration()
|
String |
getDescription()
Return the description of this task. |
String |
getName()
Return the file name. |
String |
getString()
Return the substring to search. |
String |
getUrl()
|
void |
initializeFromAttributes(Attributes attributes)
This method is sent from the SelfDiagnoseHandler when a configuration is being processed. |
void |
run(ExecutionContext ctx,
DiagnosticTaskResult result)
Run the task. |
void |
setName(String newFileName)
Set the name of the file. |
void |
setString(String newString)
Set the substring to search. |
void |
setUp(ExecutionContext ctx)
Override this method to verify that task parameters are initialized/set correctly. |
void |
setUrl(String url)
|
Methods inherited from class com.philemonworks.selfdiagnose.DiagnosticTask |
---|
createResult, getComment, getDefaultReportTemplate, getRequestor, getTaskName, getVariableName, hasComment, isReportResults, run, run, setComment, setReportResults, setRequestor, setVariableName |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CheckFileContainsString()
Method Detail |
---|
public void initializeFromAttributes(Attributes attributes)
DiagnosticTask
initializeFromAttributes
in class DiagnosticTask
attributes
- org.xml.sax.Attributespublic String getDescription()
getDescription
in class DiagnosticTask
public String getConfiguration()
public void setUp(ExecutionContext ctx) throws DiagnoseException
DiagnosticTask
setUp
in class DiagnosticTask
ctx
- ExecutionContext
DiagnoseException
public void run(ExecutionContext ctx, DiagnosticTaskResult result) throws DiagnoseException
DiagnosticTask
run
in class DiagnosticTask
ctx
- ExecutionContextresult
- DiagnosticTaskResult
DiagnoseException
public String getName()
public String getString()
public void setName(String newFileName)
string
- the name of the file/resourcepublic void setString(String newString)
string
- public String getUrl()
public void setUrl(String url)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |