Class AbstractRemoteProcessBuilder

  • All Implemented Interfaces:
    IRemoteProcessBuilder

    public abstract class AbstractRemoteProcessBuilder
    extends java.lang.Object
    implements IRemoteProcessBuilder
    Abstract base class for remote process builders. Implementors can use this class to provide a default implementation of a remote process builder.
    Since:
    5.0
    • Constructor Detail

      • AbstractRemoteProcessBuilder

        public AbstractRemoteProcessBuilder​(IRemoteConnection connection,
                                            java.util.List<java.lang.String> command)
        Since:
        2.0
      • AbstractRemoteProcessBuilder

        public AbstractRemoteProcessBuilder​(IRemoteConnection connection,
                                            java.lang.String... command)
        Since:
        2.0
    • Method Detail

      • command

        public java.util.List<java.lang.String> command()
        Description copied from interface: IRemoteProcessBuilder
        Returns this process builder's operating system program and arguments.
        Specified by:
        command in interface IRemoteProcessBuilder
        Returns:
        a list containing the program and arguments
      • directory

        public org.eclipse.core.filesystem.IFileStore directory()
        Description copied from interface: IRemoteProcessBuilder
        Returns this process builder's working directory.
        Specified by:
        directory in interface IRemoteProcessBuilder
        Returns:
        an IFileStore reference to the working directory
      • environment

        public abstract java.util.Map<java.lang.String,​java.lang.String> environment()
        Description copied from interface: IRemoteProcessBuilder
        Returns a string map view of this process builder's environment. The returned map behaves in the same manner as described in ProcessBuilder.environment().
        Specified by:
        environment in interface IRemoteProcessBuilder
        Returns:
        the process builder's environment
      • getSupportedFlags

        public abstract int getSupportedFlags()
        Description copied from interface: IRemoteProcessBuilder
        Get the flags that are supported by this process builder.
        Specified by:
        getSupportedFlags in interface IRemoteProcessBuilder
        Returns:
        bitwise-or of the supported flags
        Since:
        5.0
      • redirectErrorStream

        public boolean redirectErrorStream()
        Description copied from interface: IRemoteProcessBuilder
        Tells whether this process builder merges standard error and standard output.
        Specified by:
        redirectErrorStream in interface IRemoteProcessBuilder
        Returns:
        true if standard error and standard output will be merged
      • start

        public IRemoteProcess start()
                             throws java.io.IOException
        Description copied from interface: IRemoteProcessBuilder
        Starts a new process using the attributes of this process builder.
        Specified by:
        start in interface IRemoteProcessBuilder
        Returns:
        remote process object
        Throws:
        java.io.IOException
      • start

        public abstract IRemoteProcess start​(int flags)
                                      throws java.io.IOException
        Description copied from interface: IRemoteProcessBuilder
        Starts a new process using the attributes of this process builder. The flags may be used to modify behavior of the remote process. These flags may only be supported by specific types of remote service providers. Clients can use IRemoteProcessBuilder.getSupportedFlags() to find out the flags supported by the service provider.
         Current flags are:
           NONE                 - disable any flags
           ALLOCATE_PTY - allocate a pseudo-terminal for the process (RFC-4254 Sec. 6.2)
           FORWARD_X11  - enable X11 forwarding (RFC-4254 Sec. 6.3)
         
        Specified by:
        start in interface IRemoteProcessBuilder
        Parameters:
        flags - bitwise-or of flags to use when starting process
        Returns:
        remote process object
        Throws:
        java.io.IOException
        Since:
        5.0
      • toString

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

        protected IRemoteProcess newRemoteProcess()
        Since:
        4.0