public abstract class AbstractMagickCommand extends Object
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_SUBCOMMAND_CONVERT
Default Graphics Magick command executable.
|
static String |
PROP_TIMEOUT
System property name for Graphics Magick command executable.
|
Constructor and Description |
---|
AbstractMagickCommand(String executable,
String subCommand)
Constructor with a sub-command.
|
Modifier and Type | Method and Description |
---|---|
void |
addArgument(String argument)
Add a command line argument to Magick command.
|
void |
clearArguments()
Remove all the Magick command line arguments.
|
protected abstract org.apache.commons.exec.CommandLine |
createCommandLine()
Create a
CommandLine from executable and arguments. |
void |
execute()
Execute the Magick command with the sub-command and arguments.
|
void |
execute(OutputStream stdOut)
Execute the Magick command with the sub-command and arguments.
|
List<String> |
getArguments()
Returns the command line arguments after the sub-command.
|
String |
getExecutable()
Returns the executable of Magick command.
|
String |
getSubCommand()
Returns the sub-command of Graphics Magick command.
|
File |
getWorkingDirectory()
Returns working directory.
|
void |
setWorkingDirectory(File workingDirectory)
Sets working directory
|
public static final String DEFAULT_SUBCOMMAND_CONVERT
public static final String PROP_TIMEOUT
public File getWorkingDirectory()
public void setWorkingDirectory(File workingDirectory)
workingDirectory
- working directorypublic String getExecutable()
public String getSubCommand()
public List<String> getArguments()
public void addArgument(String argument)
argument
- a command line argument to Magick commandpublic void clearArguments()
public void execute() throws IOException
MagickExecuteException
- if an execution exception occursIOException
- if IO exception occurspublic void execute(OutputStream stdOut) throws IOException
stdOut
- standard output streamMagickExecuteException
- if an execution exception occursIOException
- if IO exception occursprotected abstract org.apache.commons.exec.CommandLine createCommandLine()
CommandLine
from executable and arguments.CommandLine
from executable and argumentsCopyright © 2019. All rights reserved.