Package com.nomagic.license.utils.exec
Class CommandlineImpl
java.lang.Object
com.nomagic.license.utils.exec.CommandlineImpl
- All Implemented Interfaces:
Commandline
-
Field Summary
Fields inherited from interface com.nomagic.license.utils.exec.Commandline
DEFAULT_TIMEOUT
-
Constructor Summary
ConstructorDescriptionCommandlineImpl
(boolean logEnabled) CommandlineImpl
(long timeout) CommandlineImpl
(long timeout, boolean logEnabled) -
Method Summary
Modifier and TypeMethodDescriptionExecute command lineExecute command lineExecute command lineExecute command lineExecute command lineExecute command lineExecute command lineExecute command linelong
boolean
void
Print some log information.protected void
protected void
protected ProcessOutput
void
setLogEnabled
(boolean logEnabled) void
setTimeout
(long timeout)
-
Constructor Details
-
CommandlineImpl
public CommandlineImpl() -
CommandlineImpl
public CommandlineImpl(long timeout) -
CommandlineImpl
public CommandlineImpl(boolean logEnabled) -
CommandlineImpl
public CommandlineImpl(long timeout, boolean logEnabled)
-
-
Method Details
-
read
- Throws:
InterruptedException
IOException
-
log
Description copied from interface:Commandline
Print some log information.- Specified by:
log
in interfaceCommandline
-
log
-
log
-
execute
public ProcessOutput execute(String cmd, @CheckForNull String[] environment, @CheckForNull File dir) throws IOException, InterruptedException Execute command line- Specified by:
execute
in interfaceCommandline
- Parameters:
dir
- file working directorycmd
- command line- Returns:
- output of command
- Throws:
IOException
InterruptedException
-
execute
public ProcessOutput execute(String cmd, String[] environment) throws IOException, InterruptedException Execute command line- Specified by:
execute
in interfaceCommandline
- Parameters:
cmd
- command line- Returns:
- output of command
- Throws:
IOException
InterruptedException
-
execute
Execute command line- Specified by:
execute
in interfaceCommandline
- Parameters:
dir
- file working directorycmd
- command line- Returns:
- output of command
- Throws:
IOException
InterruptedException
-
execute
Execute command line- Specified by:
execute
in interfaceCommandline
- Parameters:
cmd
- command line- Returns:
- output of command
- Throws:
IOException
InterruptedException
-
execute
public ProcessOutput execute(String[] cmd, @CheckForNull String[] environment, @CheckForNull File dir) throws IOException, InterruptedException Execute command line- Specified by:
execute
in interfaceCommandline
- Parameters:
dir
- file working directorycmd
- command line- Returns:
- output of command
- Throws:
IOException
InterruptedException
-
execute
public ProcessOutput execute(String[] cmd, String[] environment) throws IOException, InterruptedException Execute command line- Specified by:
execute
in interfaceCommandline
- Parameters:
cmd
- command line- Returns:
- output of command
- Throws:
IOException
InterruptedException
-
execute
Execute command line- Specified by:
execute
in interfaceCommandline
- Parameters:
dir
- file working directorycmd
- command line- Returns:
- output of command
- Throws:
IOException
InterruptedException
-
execute
Execute command line- Specified by:
execute
in interfaceCommandline
- Parameters:
cmd
- command line- Returns:
- output of command
- Throws:
IOException
InterruptedException
-
getTimeout
public long getTimeout()- Specified by:
getTimeout
in interfaceCommandline
- Returns:
-
setTimeout
public void setTimeout(long timeout) - Specified by:
setTimeout
in interfaceCommandline
-
isLogEnabled
public boolean isLogEnabled()- Specified by:
isLogEnabled
in interfaceCommandline
- Returns:
-
setLogEnabled
public void setLogEnabled(boolean logEnabled)
-