X-Git-Url: http://git.megacz.com/?p=org.ibex.jinetd.git;a=blobdiff_plain;f=src%2Forg%2Fibex%2Fjinetd%2FWatched.java;fp=src%2Forg%2Fibex%2Fjinetd%2FWatched.java;h=0000000000000000000000000000000000000000;hp=332c0f4f15a177f4735257e568036af55b5fe7ad;hb=501b9089d3cf777fc417d9bcddba9bc542a086f9;hpb=583587a3f34a3d2939bcc2b7bcab51b871f2b0c7 diff --git a/src/org/ibex/jinetd/Watched.java b/src/org/ibex/jinetd/Watched.java deleted file mode 100644 index 332c0f4..0000000 --- a/src/org/ibex/jinetd/Watched.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2000-2005 the Contributors, as shown in the revision logs. -// Licensed under the Apache Public Source License 2.0 ("the License"). -// You may not use this file except in compliance with the License. - -package org.ibex.jinetd; -import org.ibex.util.*; -import java.io.*; -import java.util.*; - -public class Watched extends File { - - // Instance ////////////////////////////////////////////////////////////////////////////// - - private Hashtable cache = new Hashtable(); - long lastModifiedAtLastScan = -1; - public final String path; - public final String part; - - public Watcher watcher() { return ((Watched)all.get(getParent())).watcher(); } - public Watched slash(String part) { return get(this.path + File.separatorChar + part); } - public void scan() throws IOException { - if (!exists()) { return; } - if (lastModifiedAtLastScan != lastModified()) { watcher().changed(this); lastModifiedAtLastScan = lastModified(); } - if (!isDirectory()) { return; } - Vec removals = new Vec(); - for(Iterator i = cache.values().iterator(); i.hasNext();) { - Watched w = ((Watched)i.next()); - if (w.exists()) w.scan(); - else { watcher().changed(w); removals.addElement(w.path.substring(this.path.length() + 1)); } - } - for(int i=0; i