public class FileWriterVisitor extends Object implements FileContentVisitor
FileContentVisitor which writes the received content into an outputStream| Constructor and Description |
|---|
FileWriterVisitor(OutputStream outputStream,
org.mule.runtime.api.message.MuleEvent event,
String encoding)
Creates a new instance
|
| Modifier and Type | Method and Description |
|---|---|
void |
visit(byte content)
Invoked when the file has one single
byte as content |
void |
visit(byte[] content)
Invoked when the file has one single
byte[] as content |
void |
visit(InputStream content)
Invoked when the file has an
InputStream as content |
void |
visit(OutputHandler handler)
Invoked when the file has an
OutputHandler as content |
void |
visit(String content)
Invoked when the file has
String content |
public FileWriterVisitor(OutputStream outputStream, org.mule.runtime.api.message.MuleEvent event, String encoding)
outputStream - the stream to write intoevent - a MuleEvent to be used to power the visit(OutputHandler) caseencoding - the encoding to use when writing a content of type Stringpublic void visit(String content) throws Exception
FileContentVisitorString contentvisit in interface FileContentVisitorcontent - the file's contentExceptionpublic void visit(byte content)
throws Exception
FileContentVisitorbyte as contentvisit in interface FileContentVisitorcontent - the file's contentExceptionpublic void visit(byte[] content)
throws Exception
FileContentVisitorbyte[] as contentvisit in interface FileContentVisitorcontent - the file's contentExceptionpublic void visit(OutputHandler handler) throws Exception
FileContentVisitorOutputHandler as contentvisit in interface FileContentVisitorhandler - the file's contentExceptionpublic void visit(InputStream content) throws Exception
FileContentVisitorInputStream as contentvisit in interface FileContentVisitorcontent - the file's contentExceptionCopyright © 2003–2016 MuleSoft, Inc.. All rights reserved.