com.sodius.mdw.core.util.io
Interface ContentWriter

All Known Subinterfaces:
InputSourceWriter

public interface ContentWriter

Used to write a text template output on disk. One can override the default file writing behavior by defining an implementation of this interface and registering it to the evaluation manager.

Clients may implement this interface.

See Also:
EvaluationManager.setContentWriter(ContentWriter)

Method Summary
 void write(File file, String charsetName, String contents)
          Writes the specified contents to the specified location.
 

Method Detail

write

void write(File file,
           String charsetName,
           String contents)
           throws IOException
Writes the specified contents to the specified location.

The specified file may or may not exist at the time this method is invoked. The implementation must create the directory as necessary.

Parameters:
file - the absolute path of the expected output location.
charsetName - the file encoding to be used, null to use the platform default encoding
contents - the contents to write at the specified location.
Throws:
IOException - if the contents could not be written out.