1 package fr.jayasoft.ivy.repository; 2 3 import java.io.IOException ; 4 import java.io.InputStream ; 5 6 public class BasicResource implements Resource { 7 private boolean _local; 8 private String _name; 9 private long _lastModified; 10 private long _contentLength; 11 private boolean _exists; 12 13 14 public BasicResource(String name, boolean exists, long contentLength, long lastModified, boolean local) { 15 _name = name; 16 _exists = exists; 17 _contentLength = contentLength; 18 _lastModified = lastModified; 19 _local = local; 20 } 21 22 public Resource clone(String cloneName) { 23 throw new UnsupportedOperationException ("basic resource do not support the clone method"); 24 } 25 26 public boolean exists() { 27 return _exists; 28 } 29 30 public long getContentLength() { 31 return _contentLength; 32 } 33 34 public long getLastModified() { 35 return _lastModified; 36 } 37 38 public String getName() { 39 return _name; 40 } 41 42 public boolean isLocal() { 43 return _local; 44 } 45 46 public InputStream openStream() throws IOException { 47 throw new UnsupportedOperationException ("basic resource do not support the openStream method"); 48 } 49 50 public String toString() { 51 return getName(); 52 } 53 54 } 55 | Popular Tags |