Class AbstractMagickCommand
java.lang.Object
org.onehippo.forge.gallerymagick.core.command.AbstractMagickCommand
- Direct Known Subclasses:
GraphicsMagickCommand
,ImageMagickCommand
Abstract *Magick Command.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionAbstractMagickCommand
(String executable, String subCommand) Constructor with a sub-command. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addArgument
(String argument) Add a command line argument to Magick command.void
Remove all the Magick command line arguments.protected abstract org.apache.commons.exec.CommandLine
Create aCommandLine
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.Returns the command line arguments after the sub-command.Returns the executable of Magick command.Returns the sub-command of Graphics Magick command.Returns working directory.void
setWorkingDirectory
(File workingDirectory) Sets working directory
-
Field Details
-
DEFAULT_SUBCOMMAND_CONVERT
Default Graphics Magick command executable.- See Also:
-
PROP_TIMEOUT
System property name for Graphics Magick command executable.- See Also:
-
-
Constructor Details
-
AbstractMagickCommand
Constructor with a sub-command.- Parameters:
executable
- executable of Magick commandsubCommand
- sub-command
-
-
Method Details
-
getWorkingDirectory
Returns working directory.- Returns:
- working directory
-
setWorkingDirectory
Sets working directory- Parameters:
workingDirectory
- working directory
-
getExecutable
Returns the executable of Magick command.- Returns:
- the executable of Magick command
-
getSubCommand
Returns the sub-command of Graphics Magick command.- Returns:
- the sub-command of Graphics Magick command
-
getArguments
Returns the command line arguments after the sub-command.- Returns:
- the command line arguments after the sub-command
-
addArgument
Add a command line argument to Magick command.- Parameters:
argument
- a command line argument to Magick command
-
clearArguments
public void clearArguments()Remove all the Magick command line arguments. -
execute
Execute the Magick command with the sub-command and arguments.- Throws:
MagickExecuteException
- if an execution exception occursIOException
- if IO exception occurs
-
execute
Execute the Magick command with the sub-command and arguments.- Parameters:
stdOut
- standard output stream- Throws:
MagickExecuteException
- if an execution exception occursIOException
- if IO exception occurs
-
createCommandLine
protected abstract org.apache.commons.exec.CommandLine createCommandLine()Create aCommandLine
from executable and arguments.- Returns:
- a
CommandLine
from executable and arguments
-