|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--ants.gnutant.UrlResource
An UrlResource is an object containing the URL from which the
content of a resource may be downloaded. When a UrlResource
is inserted in a Storage object, the storage may perform a
local copy of the resource by downloading the contents through the
input stream obtained through the getInputStream() method.
| Constructor Summary | |
UrlResource()
Default constructor for externalization. |
|
UrlResource(String url)
Constructs a new UrlResource identified by the
specified name. |
|
UrlResource(String url,
ants.gnutant.DocumentKey dockey)
Constructs a new UrlResource identified by the
specified name and dockey.
|
|
UrlResource(URL url)
Constructs a new UrlResource identified by the
specified name. |
|
| Method Summary | |
boolean |
equals(Object obj)
Check whether this UrlResource is equal to the specified object. |
String |
getAttribute(String name)
Returns the value associated to the specified attribute name, or null if there is no attribute with that name. |
long |
getContentLength()
Return the lenght of the content of the resource, if available. |
String |
getFile()
Returns the file part of this URL. |
InputStream |
getInputStream()
Return an input stream to download the contents of the resource. |
Object |
getKey()
Return the document key for this Url resource as the key. |
String |
getName()
Returns the string identifier of the object. |
String |
getURL()
Return the stringified url for this Url resource. |
int |
hashCode()
Returns a hash code value for the object. |
void |
readExternal(ObjectInput in)
Marshals this UrlResource to the specified output stream. |
long |
size()
Return the space required to store the resource object. |
String |
toString()
Returns a string representation of the object. |
void |
writeExternal(ObjectOutput out)
Marshals this UrlResource to the specified output stream. |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public UrlResource()
public UrlResource(URL url)
throws IOException
UrlResource identified by the
specified name. This will compute the hash and the length of
the referenced file.
NON-SIMULATION VERSION
url - url from which the resource may be downloadedpublic UrlResource(String url)
UrlResource identified by the
specified name. This is for simulation and will generate a
random document identifier for the referenced file.
SIMULATION VERSION.
url - url from which the resource may be downloaded
public UrlResource(String url,
ants.gnutant.DocumentKey dockey)
UrlResource identified by the
specified name and dockey.
SIMULATION VERSION.
url - url from which the resource may be downloadeddockey - DocumentKey for the specified URL.| Method Detail |
public String getName()
getName in interface Resourcepublic String getAttribute(String name)
getAttribute in interface Resourcename - the name of the attribute
public InputStream getInputStream()
throws IOException
getInputStream in interface ResourceIOExceptionpublic long getContentLength()
getContentLength in interface Resourcepublic long size()
Resource
size in interface Resourcepublic Object getKey()
getKey in interface Resourcepublic String getURL()
public String getFile()
String valuepublic boolean equals(Object obj)
UrlResource is equal to the specified object.
equals in class Objectpublic int hashCode()
hashCode in class Objectpublic String toString()
toString in class Object
public void readExternal(ObjectInput in)
throws IOException
UrlResource to the specified output stream.
readExternal in interface ExternalizableIOException
public void writeExternal(ObjectOutput out)
throws IOException
UrlResource to the specified output stream.
writeExternal in interface ExternalizableIOException
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||