KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > nilostep > xlsql > database > xlSubFolder


1 /*(Header: NiLOSTEP / xlSQL)
2
3  Copyright (C) 2004 NiLOSTEP
4    NiLOSTEP Information Sciences
5    http://nilostep.com
6    nilo.de.roock@nilostep.com
7
8  This program is free software; you can redistribute it and/or modify it under
9  the terms of the GNU General Public License as published by the Free Software
10  Foundation; either version 2 of the License, or (at your option) any later
11  version.
12
13  This program is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15  or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
16  more details. You should have received a copy of the GNU General Public License
17  along with this program; if not, write to the Free Software Foundation,
18  Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */

20 package com.nilostep.xlsql.database;
21
22 import com.nilostep.xlsql.sql.xlSqlSelect;
23
24 import java.io.File JavaDoc;
25
26 import java.util.HashMap JavaDoc;
27 import java.util.Map JavaDoc;
28 import java.util.logging.*;
29
30
31 /**
32  * Abstract SubFolder. Extend for particular use.
33  *
34  * @version $Revision: 1.3 $
35  * @author $author$
36  */

37 public abstract class xlSubFolder {
38     protected static final Logger logger = Logger.getAnonymousLogger();
39     protected static final int ADD = 0;
40     protected static final int UPDATE = 1;
41     protected static final int DELETE = 2;
42     protected File JavaDoc directory;
43     protected xlSqlSelect sqlSelect;
44     protected String JavaDoc subFolderName;
45     protected Map JavaDoc files = new HashMap JavaDoc();
46     protected Map JavaDoc validfiles = new HashMap JavaDoc();
47     protected boolean[] bDirty = new boolean[3];
48
49     /**
50      * Creates a new xlSubFolder object.
51      *
52      * @param dir DOCUMENT ME!
53      * @param name DOCUMENT ME!
54      */

55     public xlSubFolder(File JavaDoc dir, String JavaDoc name) throws xlException {
56         directory = dir;
57         subFolderName = name;
58         readFiles();
59     }
60
61     /**
62      * Creates a new xlSubFolder object.
63      *
64      * @param dir DOCUMENT ME!
65      * @param name DOCUMENT ME!
66      * @param dirty DOCUMENT ME!
67      */

68     public xlSubFolder(File JavaDoc dir, String JavaDoc name, boolean dirty) {
69         directory = dir;
70         subFolderName = name;
71         bDirty[ADD] = dirty;
72     }
73
74     /**
75      * Setter for property bDirty.
76      *
77      * @param i DOCUMENT ME!
78      * @param val DOCUMENT ME!
79      */

80     public void setDirty(int i, boolean val) {
81         bDirty[i] = val;
82     }
83
84     /**
85      * Getter for property files.
86      *
87      * @return Value of property files.
88      */

89     public java.util.Map JavaDoc getFiles() {
90         return files;
91     }
92
93     /**
94      * Getter for property validfiles.
95      *
96      * @return Value of property validfiles.
97      */

98     public java.util.Map JavaDoc getValidFiles() {
99         return validfiles;
100     }
101
102     /**
103      * Getter for property subFolderName.
104      *
105      * @return Value of property subFolderName.
106      */

107     public String JavaDoc getSubFolderName() {
108         return subFolderName;
109     }
110
111     protected abstract void readFiles() throws xlException;
112
113     protected abstract void close(xlSqlSelect select) throws xlException;
114 }
Popular Tags