/** * Look up a filename in the cache. * @param name the name to look up (case insensitive). * @return the filename on disc (case sensitive). * @throws IOException */ public Location lookup(Location name) throws IOException { Location parent = name.getParentFile(); if (parent != null) { HashMap<String, String> s = fill(parent); if (s != null) { String realname = name.getName(); String lower = realname.toLowerCase(); String f = s.get(lower); if (f != null) { return new Location(parent, f); } } } return name; } }
/** * Remove (invalidate) cached content for the specified directory. * @param dir the directory to remove, */ public static void invalidateCache(File dir) { cache.invalidate(new Location(dir.getAbsolutePath())); }
/** * Look up a filename in the cache. * @param name the name to look up (case insensitive). * @return the filename on disc (case sensitive). * @throws IOException */ public Location lookup(Location name) throws IOException { Location parent = name.getParentFile(); if (parent != null) { HashMap<String, String> s = fill(parent); if (s != null) { String realname = name.getName(); String lower = realname.toLowerCase(); String f = s.get(lower); if (f != null) { return new Location(parent, f); } } } return name; } }
/** * Remove (invalidate) cached content for all directories. */ public static void invalidateCache() { cache.invalidate(); }
/** * Remove (invalidate) cached content for all directories. */ public static void invalidateCache() { cache.invalidate(); }
private static String findCaseInsensitive(Location name) throws IOException { // The file we're looking for doesn't exist, so look for it in the // same directory in a case-insensitive manner. Note that this will // throw an exception if multiple copies are found. return cache.lookup(name.getAbsoluteFile()).getAbsolutePath(); }
private static String findCaseInsensitive(Location name) throws IOException { // The file we're looking for doesn't exist, so look for it in the // same directory in a case-insensitive manner. Note that this will // throw an exception if multiple copies are found. return cache.lookup(name.getAbsoluteFile()).getAbsolutePath(); }
/** * Remove (invalidate) cached content for the specified directory. * @param dir the directory to remove, */ public static void invalidateCache(File dir) { cache.invalidate(new Location(dir.getAbsolutePath())); }