1 package org.sapia.soto.util; 2 3 import java.io.IOException ; 4 import java.io.InputStream ; 5 6 import java.net.URL ; 7 8 9 23 public class UrlResource implements Resource { 24 static final long UNDEFINED = -1; 25 private URL _url; 26 27 public UrlResource(URL url) { 28 _url = url; 29 } 30 31 34 public long lastModified() { 35 return UNDEFINED; 36 } 37 38 41 public InputStream getInputStream() throws IOException { 42 return _url.openStream(); 43 } 44 45 48 public String getURI() { 49 return _url.toExternalForm(); 50 } 51 52 public String toString() { 53 return _url.toExternalForm(); 54 } 55 } 56 | Popular Tags |