1 17 package org.apache.excalibur.source.impl.validity; 18 19 import org.apache.excalibur.source.SourceValidity; 20 21 29 public final class ExpiresValidity 30 implements SourceValidity 31 { 32 private long expires; 33 34 38 public ExpiresValidity( long expires ) 39 { 40 this.expires = System.currentTimeMillis() + expires; 41 } 42 43 48 public int isValid() 49 { 50 final long currentTime = System.currentTimeMillis(); 51 return (currentTime <= this.expires ? SourceValidity.VALID : SourceValidity.INVALID); 52 } 53 54 60 public int isValid( SourceValidity newValidity ) 61 { 62 return SourceValidity.INVALID; 63 } 64 65 69 public String toString() 70 { 71 return "ExpiresValidity: " + expires; 72 } 73 } 74 | Popular Tags |