KickJava   Java API By Example, From Geeks To Geeks.

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


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: FileBasedStreamFactory.java,v 1.2 2003/11/07 21:34:22 per_nyfelt Exp $
8
package org.ozoneDB.tools.OPP.srcgen.streamfactory;
9
10 import org.ozoneDB.tools.OPP.OPPHelper;
11
12 import java.io.File JavaDoc;
13
14 /**
15  *
16  * @author Joakim Ohlrogge
17  */

18 public abstract class FileBasedStreamFactory {
19     private File JavaDoc directory;
20     private String JavaDoc extension;
21     private String JavaDoc postFix;
22
23     protected File JavaDoc getFile(String JavaDoc className) {
24         File JavaDoc file = new File JavaDoc(directory, OPPHelper.classFileBasename(className) + postFix + "." + extension);
25         return file;
26     }
27
28     protected String JavaDoc getFileName(String JavaDoc className) {
29         return getFile(className).toString();
30     }
31
32     public FileBasedStreamFactory(File JavaDoc directory, String JavaDoc extension) {
33         this(directory, extension, "");
34     }
35
36     public FileBasedStreamFactory(File JavaDoc directory, String JavaDoc extension, String JavaDoc postFix) {
37         this.directory = directory;
38         this.extension = extension;
39         this.postFix = postFix;
40     }
41 }
42
Popular Tags