edu.uky.rch.ept.data
Class ResourceDescriptor

java.lang.Object
  extended byedu.uky.rch.ept.data.ResourceDescriptor
All Implemented Interfaces:
Comparable

public class ResourceDescriptor
extends Object
implements Comparable

A ResourceDescriptor holds and provides all the meta-data about a resource.


Field Summary
static short R_COLLECTION
          Collection
static short R_DTD
          DTD Resource
static short R_IMAGE
          Image Resource
static short R_TEXT
          Text Resource
static short R_UNKNOWN
          Unknown Resource Type
static short R_XML
          XML Resource
 
Constructor Summary
ResourceDescriptor(String address)
          Constructs a new ResourceDescriptor with the given details
 
Method Summary
 int compareTo(Object obj)
           
 String getAddress()
          Returns the absolute address of the resource.
 String getName()
          Returns the name of the resource.
 short getType()
          Returns the type of the resource.
 boolean isCollection()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

R_UNKNOWN

public static final short R_UNKNOWN
Unknown Resource Type

See Also:
Constant Field Values

R_COLLECTION

public static final short R_COLLECTION
Collection

See Also:
Constant Field Values

R_TEXT

public static final short R_TEXT
Text Resource

See Also:
Constant Field Values

R_XML

public static final short R_XML
XML Resource

See Also:
Constant Field Values

R_DTD

public static final short R_DTD
DTD Resource

See Also:
Constant Field Values

R_IMAGE

public static final short R_IMAGE
Image Resource

See Also:
Constant Field Values
Constructor Detail

ResourceDescriptor

public ResourceDescriptor(String address)
                   throws NullAddressException,
                          UnknownProtocolException,
                          MalformedAddressException
Constructs a new ResourceDescriptor with the given details

Parameters:
address - absolute address of the resource
Method Detail

getAddress

public String getAddress()
Returns the absolute address of the resource.

Returns:
absolute address of the resource.

getType

public short getType()
Returns the type of the resource. The type is inferred from the file-extension present in the address. Valid extensions for each type are listed in IDataConstants.

Returns:
type of resource.

getName

public String getName()
Returns the name of the resource. Name is the substring following the last occurence of IDataConstants.SEP_MAJOR.

Returns:
name of the resource

isCollection

public boolean isCollection()

compareTo

public int compareTo(Object obj)
Specified by:
compareTo in interface Comparable