View Javadoc
1 // $Id: ExportCenter.java,v 1.1 2004/02/12 22:38:15 powerpete Exp $
2 // [JMP, 12.02.2004] Created this file.
3 package org.jface.stepmt.demoapp.export;
4
5 import java.io.BufferedOutputStream;
6 import java.io.FileOutputStream;
7 import java.io.IOException;
8 import java.io.OutputStream;
9
10 import org.jface.stepmt.core.Region;
11 import org.jface.stepmt.transform.SerializerPipeline;
12 import org.xml.sax.SAXException;
13
14 /***
15 * @author <a href="mailto:powerpete@users.sf.net">M. Petersen</a>
16 * @version $Id: ExportCenter.java,v 1.1 2004/02/12 22:38:15 powerpete Exp $
17 */
18 public class ExportCenter
19 {
20 public void export(
21 SerializerPipeline pipeline,
22 Region region,
23 String text,
24 String filename) throws IOException, SAXException
25 {
26 OutputStream out = null;
27 try
28 {
29 out = new BufferedOutputStream(new FileOutputStream(filename));
30 pipeline.setOutputStream(out);
31 pipeline.generate(region, text);
32 out.flush();
33 }
34 catch (IOException e)
35 {
36 throw e;
37 }
38 catch (SAXException e)
39 {
40 throw e;
41 }
42 finally
43 {
44 try
45 {
46 out.close();
47 }
48 catch (Exception e)
49 {
50 // GIVE UP.
51 }
52 }
53 }
54 }
This page was automatically generated by Maven