Class AddMetaDataValue
- java.lang.Object
-
- com.adaptris.core.services.system.AddMetaDataValue
-
- All Implemented Interfaces:
CommandOutputCapture
public class AddMetaDataValue extends java.lang.Object implements CommandOutputCapture
Implementation ofCommandOutputCapture
that saves the output of the system command to a metadata value
-
-
Constructor Summary
Constructors Constructor Description AddMetaDataValue()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getEncoding()
java.lang.String
getMetadataKey()
java.lang.Boolean
getStrip()
void
setEncoding(java.lang.String encoding)
Set the character encoding to interpret the output of the command.void
setMetadataKey(java.lang.String metadataKey)
The metadata key under which the output of the command is to be stored.void
setStrip(java.lang.Boolean strip)
Whether to strip whitespace like newlines, spaces and tabs from the command output.java.io.OutputStream
startCapture(AdaptrisMessage msg)
Capture the output from the process.
-
-
-
Method Detail
-
startCapture
public java.io.OutputStream startCapture(AdaptrisMessage msg) throws java.io.IOException
Description copied from interface:CommandOutputCapture
Capture the output from the process.- Specified by:
startCapture
in interfaceCommandOutputCapture
- Parameters:
msg
- the adaptris message.- Returns:
- an OutputStream capturing the command output.
- Throws:
java.io.IOException
- if an outputstream couldn't be created.
-
getMetadataKey
public java.lang.String getMetadataKey()
-
setMetadataKey
public void setMetadataKey(java.lang.String metadataKey)
The metadata key under which the output of the command is to be stored. May not be empty.- Parameters:
metadataKey
-
-
getEncoding
public java.lang.String getEncoding()
-
setEncoding
public void setEncoding(java.lang.String encoding)
Set the character encoding to interpret the output of the command. By default the JVM encoding will be used.- Parameters:
encoding
-
-
getStrip
public java.lang.Boolean getStrip()
-
setStrip
public void setStrip(java.lang.Boolean strip)
Whether to strip whitespace like newlines, spaces and tabs from the command output. Default: true- Parameters:
strip
-
-
-