01: // DirectoryUpdateHandler.java
02: // $Id: DirectoryUpdateHandler.java,v 1.5 2000/08/16 21:37:26 ylafon Exp $
03: // (c) COPYRIGHT MIT and INRIA, 1997.
04: // Please first read the full copyright statement in file COPYRIGHT.html
05:
06: package org.w3c.cvs;
07:
08: import java.io.File;
09:
10: class DirectoryUpdateHandler extends UpdateHandler implements CVS {
11: CvsDirectory cvs = null;
12: long stamp = -1;
13:
14: void notifyEntry(String filename, int status) {
15: // Look for the appropriate CVS manager:
16: File file = new File(cvs.getDirectory(), filename);
17: File dir = new File(file.getParent());
18: String name = file.getName();
19: CvsDirectory child = null;
20: try {
21: child = CvsDirectory.getManager(cvs, dir);
22: } catch (CvsException ex) {
23: return;
24: }
25: // Add an entry for the file:
26: CvsEntry entry = child.getFileEntry(name);
27: if (entry == null)
28: child.createFileEntry(stamp, name, status);
29: else
30: entry.setStatus(stamp, status);
31: }
32:
33: DirectoryUpdateHandler(CvsDirectory cvs) {
34: this.cvs = cvs;
35: this.stamp = System.currentTimeMillis();
36: }
37: }
|