KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > ozoneDB > tools > OPP > srcgen > streamfactory > FileOutputStreamFactory


1 // You can redistribute this software and/or modify it under the terms of
2
// the Ozone Library License version 1 published by ozone-db.org.
3
//
4
// The original code and portions created by SMB are
5
// Copyright (C) 1997-@year@ by SMB GmbH. All rights reserved.
6
//
7
// $Id: FileOutputStreamFactory.java,v 1.2 2003/11/07 21:34:22 per_nyfelt Exp $
8
package org.ozoneDB.tools.OPP.srcgen.streamfactory;
9
10 import java.io.*;
11
12 /**
13  *
14  * @author Joakim Ohlrogge
15  */

16 public class FileOutputStreamFactory extends FileBasedStreamFactory implements OutputStreamFactory {
17     public FileOutputStreamFactory(File directory, String JavaDoc extension) {
18         super(directory, extension);
19     }
20
21     public OutputStream newInstance(String JavaDoc className) throws IOException {
22         File file = getFile(className);
23         file.getParentFile().mkdirs();
24         return new FileOutputStream(file);
25     }
26 }
27
Popular Tags