public class CommandLineTransform extends Object implements MetadataTransform
MetadataTransform.HistoricalWrapper, MetadataTransform.Keyset, MetadataTransform.TransmissionDecision
KEY_CONTENT_TYPE, KEY_CRAWL_ONCE, KEY_DISPLAY_URL, KEY_DOC_ID, KEY_FORCED_TRANSMISSION_DECISION, KEY_LAST_MODIFIED_MILLIS_UTC, KEY_LOCK, KEY_TRANSMISSION_DECISION
Constructor and Description |
---|
CommandLineTransform() |
Modifier and Type | Method and Description |
---|---|
static CommandLineTransform |
create(Map<String,String> config)
Accepts keys
"cmd" , "workingDirectory" , and "arg?" . |
boolean |
getCommandAcceptsParameters() |
List<String> |
getTransformCommand() |
File |
getWorkingDirectory() |
void |
setCommandAcceptsParameters(boolean commandAcceptsParameters)
This controls whether the input parameters to the transform call are passed
along to the actual call to the command.
|
void |
setTransformCommand(List<String> transformCommand)
Sets the command that is in charge of transforming the document content.
|
void |
setWorkingDirectory(File dir)
Sets the working directory.
|
void |
transform(Metadata metadata,
Map<String,String> params)
Any changes to
metadata and params will be
passed on to subsequent transforms. |
public static CommandLineTransform create(Map<String,String> config)
"cmd"
, "workingDirectory"
, and "arg?"
.
The "arg?"
configuration values should be numerically increasing
starting from one: "arg1"
, "arg2"
, "arg3
, ...config
- configurationpublic void transform(Metadata metadata, Map<String,String> params)
MetadataTransform
metadata
and params
will be
passed on to subsequent transforms. This method must be thread-safe.transform
in interface MetadataTransform
metadata
- of documentparams
- are extra contextual informationpublic void setCommandAcceptsParameters(boolean commandAcceptsParameters)
commandAcceptsParameters
- param passing booleanpublic boolean getCommandAcceptsParameters()
public void setTransformCommand(List<String> transformCommand)
transformCommand
- transformpublic void setWorkingDirectory(File dir)
dir
- directoryIllegalArgumentException
- if dir
is not a directorypublic File getWorkingDirectory()