Package com.cmobilecom.af.util.db
Class CommandDialectItem
- java.lang.Object
-
- com.cmobilecom.af.util.db.DialectItem
-
- com.cmobilecom.af.util.db.CommandDialectItem
-
public class CommandDialectItem extends DialectItem
CommandDialectItem: describe a command that can be executed on local operating system.- Since:
- 4.2
-
-
Constructor Summary
Constructors Constructor Description CommandDialectItem(java.lang.String[] command, java.lang.String stdoutFile, java.lang.String stdoutCharset)
Create CommandDialectItem
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String[]
getCommand()
Get command including name and its arguments such as program arg1 arg2 ...java.lang.String
getStdoutCharset()
Get the charset of stdout filejava.lang.String
getStdoutFile()
Get output file path to store command stdout.void
run(DbExec dbExec, VariableResolver resolver)
Run the item using the DbExec.void
setCommand(java.lang.String[] command)
Set command including name and its arguments such as program arg1 arg2 ...void
setStdoutCharset(java.lang.String stdoutCharset)
Set the charset of stdout filevoid
setStdoutFile(java.lang.String stdoutFile)
Set output file path to store command stdout.java.lang.String
toString()
-
-
-
Constructor Detail
-
CommandDialectItem
public CommandDialectItem(java.lang.String[] command, java.lang.String stdoutFile, java.lang.String stdoutCharset)
Create CommandDialectItem- Parameters:
command
- command including name and its arguments such as program arg1 arg2 ...stdoutFile
- output file path to store command stdout. null for ignoring stdout.stdoutCharset
- the charset of stdout file. null for ignoring stdout.
-
-
Method Detail
-
getCommand
public java.lang.String[] getCommand()
Get command including name and its arguments such as program arg1 arg2 ...- Returns:
- program name and arguments as array
-
setCommand
public void setCommand(java.lang.String[] command)
Set command including name and its arguments such as program arg1 arg2 ...- Parameters:
command
- program name and arguments as array
-
getStdoutFile
public java.lang.String getStdoutFile()
Get output file path to store command stdout.- Returns:
- file absolute path. return null if command stdout is ignored
-
setStdoutFile
public void setStdoutFile(java.lang.String stdoutFile)
Set output file path to store command stdout.- Parameters:
stdoutFile
- stdout file absolute path, null to ignore command stdout.
-
getStdoutCharset
public java.lang.String getStdoutCharset()
Get the charset of stdout file- Returns:
- java standard charset such as UTF-8. return null if command stdout is ignored.
-
setStdoutCharset
public void setStdoutCharset(java.lang.String stdoutCharset)
Set the charset of stdout file- Parameters:
stdoutCharset
- java standard charset such as UTF-8.
-
run
public void run(DbExec dbExec, VariableResolver resolver) throws ExecException
Description copied from class:DialectItem
Run the item using the DbExec.- Specified by:
run
in classDialectItem
- Parameters:
dbExec
- DbExec instanceresolver
- variable resolver- Throws:
ExecException
- throw if command execution error occurs
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-