KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > ejtools > archive > io > FileWriter


1 /*
2  * EJTools, the Enterprise Java Tools
3  *
4  * Distributable under LGPL license.
5  * See terms of license at www.gnu.org.
6  */

7 package org.ejtools.archive.io;
8
9 import java.io.File JavaDoc;
10 import java.io.FileOutputStream JavaDoc;
11 import java.io.IOException JavaDoc;
12 import java.util.zip.ZipOutputStream JavaDoc;
13
14 /**
15  * Writer implementation based on a File. The file is transformed into a stream.
16  *
17  * @author Laurent Etiemble
18  * @version $Revision: 1.2 $
19  */

20 public class FileWriter extends StreamWriter
21 {
22    /**
23     * Builds a FileWriter on a File
24     *
25     * @param file The File to write
26     */

27    public FileWriter(File JavaDoc file)
28    {
29       try
30       {
31          FileOutputStream JavaDoc fos = new FileOutputStream JavaDoc(file);
32          this.pushZipOutputStream(new ZipOutputStream JavaDoc(fos));
33       }
34       catch (IOException JavaDoc ioe)
35       {
36          ioe.printStackTrace();
37       }
38    }
39 }
40
Popular Tags