1 //
2 // CamlFile.java
3 // CocoDonkey
4 // $Id: CamlFile.java,v 1.1 2002/08/21 21:51:31 fortun Exp $
5 //
6 // Created by Frederic Ortun on Wed Aug 21 2002.
7 // Copyright (c) 2002 Bonzoun. All rights reserved.
8 //
9 // This library is free software; you can redistribute it and/or modify
10 // it under the terms of the GNU Lesser General Public License as published
11 // by the Free Software Foundation; either version 2.1 of the License, or
12 // (at your option) any later version.
13 //
14 // This library is distributed in the hope that it will be useful,
15 // but WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 // GNU Lesser General Public License for more details.
18 //
19 // You should have received a copy of the GNU Lesser General Public License
20 // along with this program; if not, write to the Free Software
21 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 //
23
24 package net.bonzoun.cocodonkey;
25
26 import java.io;
27 import java.util.Date;
28
29 public class CamlFile {
30
31 private File file;
32 private long modTime;
33 private CamlData data;
34
35 public CamlFile(String fname) {
36 file = new File(fname);
37 }
38
39 /*** Returns the parsed content of the file. This is always updated when needed ***/
40 public CamlData data() {
41 long t = file.lastModified();
42 if (t != modTime) {
43 modTime = t;
44 data = CamlParser.parse(file);
45 }
46 return data;
47 }
48
49 /*** Returns the parsed content of the file. This is not updated ***/
50 public CamlData lastData() {
51 return data;
52 }
53 }
54
55 // $Log: CamlFile.java,v $
56 // Revision 1.1 2002/08/21 21:51:31 fortun
57 // *** empty log message ***
58 //