/** * Checks if the attributes have expired and if they have, calls {@link #updateAttributes()} to refresh their * values. * * @param forceUpdate if true, attributes will systematically be updated, without checking the expiration date */ protected void checkForExpiration(boolean forceUpdate) { if(forceUpdate || hasExpired()) { // After this method is called, hasExpired() returns false so that implementations of updateAttributes() // can query attribute getters without entering a loop of death. setUpdating(true); // Updates attribute values updateAttributes(); // Update expiration date after the attribute have actually been updated, note that it may take a while // for remote file protocols to retrieve attributes. updateExpirationDate(); // OK we're done setUpdating(false); } }