public class CommandLineConverter extends CommandLineBasedConverter
The command line to call is stored in the CommandLineName
parameter.
The target file name is in the targetFileName
parameter. If it's null, a temporary one will be created.
All the converter parameters are passed to the command line.
A sample contribution using this converter:
application/pdf image/jpeg image/png image/gif pdftoimage
CommandLineBasedConverter.CmdReturn
Modifier and Type | Field and Description |
---|---|
static String |
OUT_DIR_PATH_KEY |
static List<String> |
RESERVED_PARAMETERS |
static String |
SOURCE_FILE_PATH_KEY |
static String |
TARGET_FILE_NAME_KEY |
static String |
TARGET_FILE_PATH_KEY |
CMD_NAME_PARAMETER, initParameters, TMP_PATH_PARAMETER
Constructor and Description |
---|
CommandLineConverter() |
Modifier and Type | Method and Description |
---|---|
protected BlobHolder |
buildResult(List<String> cmdOutput,
CmdParameters cmdParams)
Builds result from commandLine output buffer.
|
protected Map<String,Blob> |
getCmdBlobParameters(BlobHolder blobHolder,
Map<String,Serializable> parameters)
Extracts BlobParameters.
|
protected Map<String,String> |
getCmdStringParameters(BlobHolder blobHolder,
Map<String,Serializable> parameters)
Extracts String parameters.
|
convert, execOnBlob, getCommandLineService, getCommandName, getTmpDirectory, init, isConverterAvailable
public static final String SOURCE_FILE_PATH_KEY
public static final String OUT_DIR_PATH_KEY
public static final String TARGET_FILE_NAME_KEY
public static final String TARGET_FILE_PATH_KEY
public static final List<String> RESERVED_PARAMETERS
public CommandLineConverter()
protected Map<String,Blob> getCmdBlobParameters(BlobHolder blobHolder, Map<String,Serializable> parameters) throws ConversionException
CommandLineBasedConverter
getCmdBlobParameters
in class CommandLineBasedConverter
ConversionException
protected Map<String,String> getCmdStringParameters(BlobHolder blobHolder, Map<String,Serializable> parameters) throws ConversionException
CommandLineBasedConverter
getCmdStringParameters
in class CommandLineBasedConverter
ConversionException
protected BlobHolder buildResult(List<String> cmdOutput, CmdParameters cmdParams) throws ConversionException
CommandLineBasedConverter
buildResult
in class CommandLineBasedConverter
ConversionException
Copyright © 2018 Nuxeo. All rights reserved.