Class 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 file
      java.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 file
      void setStdoutFile​(java.lang.String stdoutFile)
      Set output file path to store command stdout.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • 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.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object