public class DefaultFileMarshaler extends MarshalerSupport implements FileMarshaler
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
FILE_CONTENT |
protected static PropertyExpression |
FILE_CONTENT_EXPRESSION |
protected static PropertyExpression |
FILE_NAME_EXPRESSION |
static java.lang.String |
FILE_NAME_PROPERTY |
static java.lang.String |
FILE_PATH_PROPERTY |
protected static PropertyExpression |
TEMP_FILE_NAME_EXPRESSION |
static java.lang.String |
TEMP_FILE_NAME_PROPERTY |
| Constructor and Description |
|---|
DefaultFileMarshaler() |
| Modifier and Type | Method and Description |
|---|---|
Expression |
getContent() |
java.lang.String |
getEncoding() |
Expression |
getFileName() |
java.lang.String |
getOutputName(javax.jbi.messaging.MessageExchange exchange,
javax.jbi.messaging.NormalizedMessage message)
Creates a output file name for the given exchange when reading an inbound
message.
|
java.lang.String |
getTempOutputName(javax.jbi.messaging.MessageExchange exchange,
javax.jbi.messaging.NormalizedMessage message)
creates a temporary file name for the given exchange when reading an inbound
message.
|
void |
readMessage(javax.jbi.messaging.MessageExchange exchange,
javax.jbi.messaging.NormalizedMessage message,
java.io.InputStream in,
java.lang.String path)
Converts the file stream to a normalized message.
|
void |
setContent(Expression content) |
void |
setEncoding(java.lang.String encoding) |
void |
setFileName(Expression fileName) |
void |
writeMessage(javax.jbi.messaging.MessageExchange exchange,
javax.jbi.messaging.NormalizedMessage message,
java.io.OutputStream out,
java.lang.String path)
Writes the inbound message to the destination stream of the given name
|
protected void |
writeMessageContent(javax.jbi.messaging.MessageExchange exchange,
javax.jbi.messaging.NormalizedMessage message,
java.io.OutputStream out,
java.lang.String path)
Writes the message content to the given output stream
|
protected void |
writeValue(java.lang.Object value,
java.io.OutputStream out)
Writes the given value to the output stream
|
asString, getTransformer, setTransformerpublic static final java.lang.String FILE_NAME_PROPERTY
public static final java.lang.String TEMP_FILE_NAME_PROPERTY
public static final java.lang.String FILE_PATH_PROPERTY
public static final java.lang.String FILE_CONTENT
protected static final PropertyExpression FILE_NAME_EXPRESSION
protected static final PropertyExpression TEMP_FILE_NAME_EXPRESSION
protected static final PropertyExpression FILE_CONTENT_EXPRESSION
public void readMessage(javax.jbi.messaging.MessageExchange exchange,
javax.jbi.messaging.NormalizedMessage message,
java.io.InputStream in,
java.lang.String path)
throws java.io.IOException,
javax.jbi.JBIException
FileMarshalerreadMessage in interface FileMarshalerexchange - the message exchangemessage - the message to populatein - the input streampath - the name of the file, URI or URLjava.io.IOExceptionjavax.jbi.JBIExceptionpublic java.lang.String getOutputName(javax.jbi.messaging.MessageExchange exchange,
javax.jbi.messaging.NormalizedMessage message)
throws javax.jbi.messaging.MessagingException
FileMarshalergetOutputName in interface FileMarshalerexchange - the inbound message exchangemessage - the inbound messagejavax.jbi.messaging.MessagingExceptionpublic java.lang.String getTempOutputName(javax.jbi.messaging.MessageExchange exchange,
javax.jbi.messaging.NormalizedMessage message)
throws javax.jbi.messaging.MessagingException
FileMarshalergetTempOutputName in interface FileMarshalerexchange - the inbound message exchangemessage - the inbound messagejavax.jbi.messaging.MessagingExceptionpublic void writeMessage(javax.jbi.messaging.MessageExchange exchange,
javax.jbi.messaging.NormalizedMessage message,
java.io.OutputStream out,
java.lang.String path)
throws java.io.IOException,
javax.jbi.JBIException
FileMarshalerwriteMessage in interface FileMarshalerexchange - the inbound message exchangemessage - the inbound messageout - the output stream to write tojava.io.IOExceptionjavax.jbi.JBIExceptionpublic Expression getContent()
public void setContent(Expression content)
public Expression getFileName()
public void setFileName(Expression fileName)
public void setEncoding(java.lang.String encoding)
public java.lang.String getEncoding()
protected void writeValue(java.lang.Object value,
java.io.OutputStream out)
throws java.io.IOException,
javax.jbi.messaging.MessagingException
value - the value to be written to the streamout - the output streamjava.io.IOExceptionjavax.jbi.messaging.MessagingExceptionprotected void writeMessageContent(javax.jbi.messaging.MessageExchange exchange,
javax.jbi.messaging.NormalizedMessage message,
java.io.OutputStream out,
java.lang.String path)
throws javax.jbi.messaging.MessagingException
message - the message who's content we are about to writeout - the destination of the outputpath - the name of the output resource (file, uri, url)javax.jbi.messaging.MessagingExceptionCopyright © 2005-2014 FuseSource. All Rights Reserved.