diff options
Diffstat (limited to 'libjava/gnu/gcj/util/path/CacheEntry.java')
-rw-r--r-- | libjava/gnu/gcj/util/path/CacheEntry.java | 65 |
1 files changed, 0 insertions, 65 deletions
diff --git a/libjava/gnu/gcj/util/path/CacheEntry.java b/libjava/gnu/gcj/util/path/CacheEntry.java deleted file mode 100644 index 949200b..0000000 --- a/libjava/gnu/gcj/util/path/CacheEntry.java +++ /dev/null @@ -1,65 +0,0 @@ -// CacheEntry.java -- directory cache - -/* Copyright (C) 1999 Cygnus Solutions - - This file is part of libgcj. - -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -details. */ - -/* Author: Kresten Krab Thorup <krab@gnu.org> */ - -package gnu.gcj.util.path; - -import java.util.*; -import java.util.zip.*; -import java.io.*; -import java.net.*; - - -final class CacheEntry { - String dir; - String[] files; - long time; - - CacheEntry (String d) - { - dir = d; - files = new File(dir).list(); - time = System.currentTimeMillis (); - } - - void touch () - { - time = System.currentTimeMillis (); - } - - final long EXPIRATION_TIME_MS = 1000; - - boolean is_old () { - return (System.currentTimeMillis () - time) > EXPIRATION_TIME_MS; - } - - public int hashCode () { return dir.hashCode(); } - boolean contains (String file) { - if (files == null) - return false; - - int index = file.lastIndexOf(SearchPath.file_seperator_char); - String f; - - if (index == -1) - f = file; - else - f = file.substring (index+1); - - for (int i = 0; i < files.length; i++) - { - if (f.equals (files[i])) return true; - } - - return false; - } -} - |