Class AbstractMagickCommand
java.lang.Object
org.onehippo.forge.gallerymagick.core.command.AbstractMagickCommand
- Direct Known Subclasses:
GraphicsMagickCommand,ImageMagickCommand
Abstract *Magick Command.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAbstractMagickCommand(String executable, String subCommand) Constructor with a sub-command. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddArgument(String argument) Add a command line argument to Magick command.voidRemove all the Magick command line arguments.protected abstract org.apache.commons.exec.CommandLineCreate aCommandLinefrom executable and arguments.voidexecute()Execute the Magick command with the sub-command and arguments.voidexecute(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.voidsetWorkingDirectory(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 aCommandLinefrom executable and arguments.- Returns:
- a
CommandLinefrom executable and arguments
-