|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--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(java.lang.String url)
Constructs a new UrlResource identified by the
specified name . |
|
UrlResource(java.lang.String url,
gnutant.DocumentKey dockey)
Constructs a new UrlResource identified by the
specified name and dockey .
|
|
UrlResource(java.net.URL url)
Constructs a new UrlResource identified by the
specified name . |
Method Summary | |
boolean |
equals(java.lang.Object obj)
Check whether this UrlResource is equal to the specified object. |
java.lang.String |
getAttribute(java.lang.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. |
java.lang.String |
getFile()
Returns the file part of this URL. |
java.io.InputStream |
getInputStream()
Return an input stream to download the contents of the resource. |
java.lang.Object |
getKey()
Return the document key for this Url resource as the key. |
java.lang.String |
getName()
Returns the string identifier of the object. |
java.lang.String |
getURL()
Return the stringified url for this Url resource. |
int |
hashCode()
Returns a hash code value for the object. |
void |
readExternal(java.io.ObjectInput in)
Marshals this UrlResource to the specified output stream. |
long |
size()
Return the space required to store the resource object. |
java.lang.String |
toString()
Returns a string representation of the object. |
void |
writeExternal(java.io.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(java.net.URL url) throws java.io.IOException
UrlResource
identified by the
specified name
. This will compute the hash and the length of
the referenced file.
NON-SIMULATION VERSIONname
- identifier of the resourceurl
- url from which the resource may be downloadedpublic UrlResource(java.lang.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 downloadedpublic UrlResource(java.lang.String url, 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 java.lang.String getName()
getName
in interface Resource
public java.lang.String getAttribute(java.lang.String name)
getAttribute
in interface Resource
name
- the name of the attributepublic java.io.InputStream getInputStream() throws java.io.IOException
getInputStream
in interface Resource
public long getContentLength()
getContentLength
in interface Resource
public long size()
Resource
size
in interface Resource
public java.lang.Object getKey()
getKey
in interface Resource
public java.lang.String getURL()
public java.lang.String getFile()
String
valuepublic boolean equals(java.lang.Object obj)
UrlResource
is equal to the specified object.equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public void readExternal(java.io.ObjectInput in) throws java.io.IOException
UrlResource
to the specified output stream.readExternal
in interface java.io.Externalizable
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
UrlResource
to the specified output stream.writeExternal
in interface java.io.Externalizable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |