Logger.log.info("Trying to load from path " + fullpath); File f = res.getFile(); long modtime = f.lastModified(); if (modtime > staleness.modtime) { staleness.modtime = modtime; isstale = true;
if (res instanceof ClassPathResource) { staleness.modtime = NEVER_STALE_MODTIME; } else {  File f = res.getFile(); long modtime = f.lastModified(); if (modtime > staleness.modtime) { staleness.modtime = modtime; isstale = true; }
  public InputStream openStream(String fullpath) {    StalenessEntry staleness = (StalenessEntry) stalenesses.get(fullpath);    boolean isnew = false;    if (staleness == null) {      isnew = true;      staleness = new StalenessEntry();    }    long now = System.currentTimeMillis();    boolean isstale = false;    Resource res = null;    try {      if (now > staleness.lastchecked + cachesecs * 1000) {        res = resourceloader.getResource(fullpath);        if (!res.exists())          return null;        try {          Logger.log.info("Trying to load from path " + fullpath);          File f = res.getFile(); // throws IOException          long modtime = f.lastModified();          if (modtime > staleness.modtime) {            staleness.modtime = modtime;            isstale = true;          }          if (isnew) {            stalenesses.put(fullpath, staleness);          }        }        catch (Exception e) {          // If it's not a file, it's always stale.          return res.getInputStream();        }      }      staleness.lastchecked = now;      return isstale ? res.getInputStream()          : UP_TO_DATE;    }    catch (Exception e) {      throw UniversalRuntimeException.accumulate(e,          "Error opening stream for resource " + fullpath);    }  }