/** * Returns {@link TimeStampValidity} as resources may change in a directory-based classloader. */ public SourceValidity getValidity() { return new TimeStampValidity(getLastModified()); }
public int isValid( SourceValidity newValidity ) { if( newValidity instanceof TimeStampValidity ) { final long timeStamp = ( (TimeStampValidity)newValidity ).getTimeStamp(); return (m_timeStamp == timeStamp ? +1 : -1); } return -1; }
/** * Generate the validity object. * * @return The generated validity object or <code>null</code> if the * component is currently not cacheable. */ public SourceValidity getValidity() { final long lm = getLastModified(); if(lm > 0) { return new TimeStampValidity(lm); } return null; }
/** * Get the Validity object. This can either wrap the last modification * date or the expires information or... * If it is currently not possible to calculate such an information * <code>null</code> is returned. */ public SourceValidity getValidity() { long lastModified = getLastModified(); if (lastModified > 0) { return new TimeStampValidity(lastModified); } return null; }
/** * Get the Validity object. This can either wrap the last modification * date or the expires information or... * If it is currently not possible to calculate such an information * <code>null</code> is returned. */ public SourceValidity getValidity() { final long lm = getLastModified(); if (lm > 0) { if (lm == m_cachedLastModificationDate) return m_cachedValidity; m_cachedLastModificationDate = lm; m_cachedValidity = new TimeStampValidity(lm); return m_cachedValidity; } return null; }
/** * Obtain a {@link SourceValidity} object. * * @return a {@link SourceValidity} object, or * <code>null</code> if this is not possible. */ public SourceValidity getValidity() { // Implementation taken from URLSource.java, Kudos :) final long lm = this.getLastModified(); if ( lm > 0 ) { if ( lm == this.m_cachedLastModificationDate ) { return this.m_cachedValidity; } this.m_cachedLastModificationDate = lm; this.m_cachedValidity = new TimeStampValidity( lm ); return this.m_cachedValidity; } return null; }
/** * Generate the validity object. Before this method can be invoked the * generateKey() method must be invoked. * * @return The generated validity object or <code>null</code> if the * component is currently not cacheable. */ public SourceValidity getValidity() { if (this.inputSource.getLastModified()!=0) { AggregatedValidity validity = new AggregatedValidity(); validity.add(new TimeStampValidity(page)); validity.add(this.inputSource.getValidity()); return validity; } else { return null; } }