1 package org.sapia.resource; 2 3 import java.io.IOException; 4 import java.io.InputStream; 5 6 /** 7 * Abstracts a file resource. 8 * 9 * @author Yanick Duchesne 10 * 11 */ 12 public interface Resource { 13 /** 14 * @return the time, in <code>millis</code>, at which this resource was 15 * last modified. 16 */ 17 public long lastModified(); 18 19 /** 20 * @return the URI that this resource corresponds to. 21 */ 22 public String getURI(); 23 24 /** 25 * @return the <code>InputStream</code> corresponding to this resource. 26 * @throws IOException 27 */ 28 public InputStream getInputStream() throws IOException; 29 30 31 /** 32 * @return the <code>Resource</code> corresponding to the given relative URI. 33 * @param uri a URI. 34 * @throws IOException 35 */ 36 public Resource getRelative(String uri) throws IOException; 37 38 } 39