|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.servicemix.components.util.MarshalerSupport
org.apache.servicemix.components.util.DefaultFileMarshaler
public class DefaultFileMarshaler
A default file transformer which assumes the file is already in XML format and requires no transformation other than to be wrapped in a normalized message..
Field Summary | |
---|---|
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 Summary | |
---|---|
DefaultFileMarshaler()
|
Method Summary | |
---|---|
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 |
Methods inherited from class org.apache.servicemix.components.util.MarshalerSupport |
---|
asString, getTransformer, setTransformer |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public 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
Constructor Detail |
---|
public DefaultFileMarshaler()
Method Detail |
---|
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
FileMarshaler
readMessage
in interface FileMarshaler
exchange
- the message exchangemessage
- the message to populatein
- the input streampath
- the name of the file, URI or URL
java.io.IOException
javax.jbi.JBIException
public java.lang.String getOutputName(javax.jbi.messaging.MessageExchange exchange, javax.jbi.messaging.NormalizedMessage message) throws javax.jbi.messaging.MessagingException
FileMarshaler
getOutputName
in interface FileMarshaler
exchange
- the inbound message exchangemessage
- the inbound message
javax.jbi.messaging.MessagingException
public java.lang.String getTempOutputName(javax.jbi.messaging.MessageExchange exchange, javax.jbi.messaging.NormalizedMessage message) throws javax.jbi.messaging.MessagingException
FileMarshaler
getTempOutputName
in interface FileMarshaler
exchange
- the inbound message exchangemessage
- the inbound message
javax.jbi.messaging.MessagingException
public 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
FileMarshaler
writeMessage
in interface FileMarshaler
exchange
- the inbound message exchangemessage
- the inbound messageout
- the output stream to write to
java.io.IOException
javax.jbi.JBIException
public 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 stream
java.io.IOException
javax.jbi.messaging.MessagingException
protected 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.MessagingException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |