ants.gnutant
Class UrlResourceSet

java.lang.Object
  |
  +--ants.gnutant.UrlResourceSet
All Implemented Interfaces:
Externalizable, Resource, Serializable

public class UrlResourceSet
extends Object
implements Resource, Externalizable

Version:
$Revision: 1.2 $
Author:
Hein Meling
See Also:
Serialized Form

Constructor Summary
UrlResourceSet()
          Default constructor for externalization.
 
Method Summary
 boolean addURL(UrlResource url)
           
 boolean equals(Object obj)
          Check whether this UrlResourceSet 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.
 InputStream getInputStream()
          Return an input stream to download the contents of the resource.
 Object getKey()
          Return the document identifier for this Url resource as the key.
 String getName()
          Returns the string identifier of the object.
 Set getUrls()
           
 int hashCode()
          Returns a hash code value for the object.
 void readExternal(ObjectInput in)
          Marshals this UrlResourceSet 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 UrlResourceSet to the specified output stream.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UrlResourceSet

public UrlResourceSet()
Default constructor for externalization.

Method Detail

getName

public String getName()
Returns the string identifier of the object.

Specified by:
getName in interface Resource

getAttribute

public String getAttribute(String name)
Returns the value associated to the specified attribute name, or null if there is no attribute with that name.

Specified by:
getAttribute in interface Resource
Parameters:
name - the name of the attribute

getInputStream

public InputStream getInputStream()
                           throws IOException
Return an input stream to download the contents of the resource. Depending on the implementation, the contents may be read from the local storage, if the resource has been copied locally; or downloaded remotely, otherwise.

Specified by:
getInputStream in interface Resource
Returns:
an input stream to read the contents of a resource;
IOException

getContentLength

public long getContentLength()
Return the lenght of the content of the resource, if available.

Specified by:
getContentLength in interface Resource
Returns:
the lenght of the content of the resource

size

public long size()
Description copied from interface: Resource
Return the space required to store the resource object.

Specified by:
size in interface Resource

getKey

public Object getKey()
Return the document identifier for this Url resource as the key.

Specified by:
getKey in interface Resource

addURL

public boolean addURL(UrlResource url)

getUrls

public Set getUrls()

equals

public boolean equals(Object obj)
Check whether this UrlResourceSet is equal to the specified object.

Overrides:
equals in class Object

hashCode

public int hashCode()
Returns a hash code value for the object.

Overrides:
hashCode in class Object

toString

public String toString()
Returns a string representation of the object.

Overrides:
toString in class Object

readExternal

public void readExternal(ObjectInput in)
                  throws IOException
Marshals this UrlResourceSet to the specified output stream.

Specified by:
readExternal in interface Externalizable
IOException

writeExternal

public void writeExternal(ObjectOutput out)
                   throws IOException
Marshals this UrlResourceSet to the specified output stream.

Specified by:
writeExternal in interface Externalizable
IOException