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
ConstructorsConstructorDescriptionCommandlineImpl(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 linelongbooleanvoidPrint some log information.protected voidprotected voidprotected ProcessOutputvoidsetLogEnabled(boolean logEnabled) voidsetTimeout(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:
InterruptedExceptionIOException
-
log
Description copied from interface:CommandlinePrint some log information.- Specified by:
login interfaceCommandline
-
log
-
log
-
execute
public ProcessOutput execute(String cmd, @CheckForNull String[] environment, @CheckForNull File dir) throws IOException, InterruptedException Execute command line- Specified by:
executein interfaceCommandline- Parameters:
dir- file working directorycmd- command line- Returns:
- output of command
- Throws:
IOExceptionInterruptedException
-
execute
public ProcessOutput execute(String cmd, String[] environment) throws IOException, InterruptedException Execute command line- Specified by:
executein interfaceCommandline- Parameters:
cmd- command line- Returns:
- output of command
- Throws:
IOExceptionInterruptedException
-
execute
Execute command line- Specified by:
executein interfaceCommandline- Parameters:
dir- file working directorycmd- command line- Returns:
- output of command
- Throws:
IOExceptionInterruptedException
-
execute
Execute command line- Specified by:
executein interfaceCommandline- Parameters:
cmd- command line- Returns:
- output of command
- Throws:
IOExceptionInterruptedException
-
execute
public ProcessOutput execute(String[] cmd, @CheckForNull String[] environment, @CheckForNull File dir) throws IOException, InterruptedException Execute command line- Specified by:
executein interfaceCommandline- Parameters:
dir- file working directorycmd- command line- Returns:
- output of command
- Throws:
IOExceptionInterruptedException
-
execute
public ProcessOutput execute(String[] cmd, String[] environment) throws IOException, InterruptedException Execute command line- Specified by:
executein interfaceCommandline- Parameters:
cmd- command line- Returns:
- output of command
- Throws:
IOExceptionInterruptedException
-
execute
Execute command line- Specified by:
executein interfaceCommandline- Parameters:
dir- file working directorycmd- command line- Returns:
- output of command
- Throws:
IOExceptionInterruptedException
-
execute
Execute command line- Specified by:
executein interfaceCommandline- Parameters:
cmd- command line- Returns:
- output of command
- Throws:
IOExceptionInterruptedException
-
getTimeout
public long getTimeout()- Specified by:
getTimeoutin interfaceCommandline- Returns:
-
setTimeout
public void setTimeout(long timeout) - Specified by:
setTimeoutin interfaceCommandline
-
isLogEnabled
public boolean isLogEnabled()- Specified by:
isLogEnabledin interfaceCommandline- Returns:
-
setLogEnabled
public void setLogEnabled(boolean logEnabled)
-