org.apache.naming.resources

Class ResourceAttributes

Implemented Interfaces:
Attributes
Known Direct Subclasses:
FileDirContext.FileResourceAttributes

public class ResourceAttributes
extends java.lang.Object
implements Attributes

Attributes implementation.

Version:
$Revision: 1.3 $

Author:
Remy Maucherat

Field Summary

static String
ALTERNATE_CONTENT_LENGTH
Content length.
static String
ALTERNATE_CREATION_DATE
Creation date.
static String
ALTERNATE_LAST_MODIFIED
Last modification date.
static String
ALTERNATE_TYPE
Type.
static String
COLLECTION_TYPE
Collection type.
static String
CONTENT_LANGUAGE
Content language.
static String
CONTENT_LENGTH
Content length.
static String
CONTENT_TYPE
MIME type of the content.
static String
CREATION_DATE
Creation date.
static String
ETAG
ETag.
static String
LAST_MODIFIED
Last modification date.
static String
NAME
Name.
static String
SOURCE
Source.
static String
TYPE
Type.
protected Attributes
attributes
External attributes.
protected boolean
collection
Collection flag.
protected long
contentLength
Content length.
protected long
creation
Creation time.
protected Date
creationDate
Creation date.
protected static SimpleDateFormat
format
HTTP date format.
protected static SimpleDateFormat[]
formats
Date formats using for Date parsing.
protected long
lastModified
Last modified time.
protected Date
lastModifiedDate
Last modified date.
protected String
name
Name.
protected String
strongETag
Strong ETag.
protected String
weakETag
Weak ETag.

Constructor Summary

ResourceAttributes()
Default constructor.
ResourceAttributes(Attributes attributes)
Merges with another attribute set.

Method Summary

Object
clone()
Clone the attributes object (WARNING: fake cloning).
Attribute
get(String attrID)
Get attribute.
NamingEnumeration
getAll()
Get all attributes.
long
getContentLength()
Get content length.
long
getCreation()
Get creation time.
Date
getCreationDate()
Get creation date.
String
getETag()
Get ETag.
String
getETag(boolean strong)
Get ETag.
NamingEnumeration
getIDs()
Get all attribute IDs.
long
getLastModified()
Get last modified time.
Date
getLastModifiedDate()
Get lastModified date.
String
getName()
Get name.
String
getResourceType()
Get resource type.
boolean
isCaseIgnored()
Case sensitivity.
boolean
isCollection()
Is collection.
Attribute
put(Attribute attribute)
Put attribute.
Attribute
put(String attrID, Object val)
Put attribute.
Attribute
remove(String attrID)
Remove attribute.
void
setCollection(boolean collection)
Set collection flag.
void
setContentLength(long contentLength)
Set content length.
void
setCreation(long creation)
Set creation.
void
setCreationDate(Date creationDate)
Creation date mutator.
void
setETag(String eTag)
Set strong ETag.
void
setLastModified(Date lastModified)
Deprecated.
void
setLastModified(long lastModified)
Set last modified.
void
setLastModifiedDate(Date lastModifiedDate)
Last modified date mutator.
void
setName(String name)
Set name.
void
setResourceType(String resourceType)
Type mutator.
int
size()
Retrieves the number of attributes in the attribute set.

Field Details

ALTERNATE_CONTENT_LENGTH

public static final String ALTERNATE_CONTENT_LENGTH
Content length.


ALTERNATE_CREATION_DATE

public static final String ALTERNATE_CREATION_DATE
Creation date.


ALTERNATE_LAST_MODIFIED

public static final String ALTERNATE_LAST_MODIFIED
Last modification date.


ALTERNATE_TYPE

public static final String ALTERNATE_TYPE
Type.


COLLECTION_TYPE

public static final String COLLECTION_TYPE
Collection type.


CONTENT_LANGUAGE

public static final String CONTENT_LANGUAGE
Content language.


CONTENT_LENGTH

public static final String CONTENT_LENGTH
Content length.


CONTENT_TYPE

public static final String CONTENT_TYPE
MIME type of the content.


CREATION_DATE

public static final String CREATION_DATE
Creation date.


ETAG

public static final String ETAG
ETag.


LAST_MODIFIED

public static final String LAST_MODIFIED
Last modification date.


NAME

public static final String NAME
Name.


SOURCE

public static final String SOURCE
Source.


TYPE

public static final String TYPE
Type.


attributes

protected Attributes attributes
External attributes.


collection

protected boolean collection
Collection flag.


contentLength

protected long contentLength
Content length.


creation

protected long creation
Creation time.


creationDate

protected Date creationDate
Creation date.


format

protected static final SimpleDateFormat format
HTTP date format.


formats

protected static final SimpleDateFormat[] formats
Date formats using for Date parsing.


lastModified

protected long lastModified
Last modified time.


lastModifiedDate

protected Date lastModifiedDate
Last modified date.


name

protected String name
Name.


strongETag

protected String strongETag
Strong ETag.


weakETag

protected String weakETag
Weak ETag.

Constructor Details

ResourceAttributes

public ResourceAttributes()
Default constructor.


ResourceAttributes

public ResourceAttributes(Attributes attributes)
Merges with another attribute set.

Method Details

clone

public Object clone()
Clone the attributes object (WARNING: fake cloning).


get

public Attribute get(String attrID)
Get attribute.


getAll

public NamingEnumeration getAll()
Get all attributes.


getContentLength

public long getContentLength()
Get content length.

Returns:
content length value


getCreation

public long getCreation()
Get creation time.

Returns:
creation time value


getCreationDate

public Date getCreationDate()
Get creation date.

Returns:
Creation date value


getETag

public String getETag()
Get ETag.

Returns:
Weak ETag


getETag

public String getETag(boolean strong)
Get ETag.

Parameters:
strong - If true, the strong ETag will be returned

Returns:
ETag


getIDs

public NamingEnumeration getIDs()
Get all attribute IDs.


getLastModified

public long getLastModified()
Get last modified time.

Returns:
lastModified time value


getLastModifiedDate

public Date getLastModifiedDate()
Get lastModified date.

Returns:
LastModified date value


getName

public String getName()
Get name.

Returns:
Name value


getResourceType

public String getResourceType()
Get resource type.

Returns:
String resource type


isCaseIgnored

public boolean isCaseIgnored()
Case sensitivity.


isCollection

public boolean isCollection()
Is collection.


put

public Attribute put(Attribute attribute)
Put attribute.


put

public Attribute put(String attrID,
                     Object val)
Put attribute.


remove

public Attribute remove(String attrID)
Remove attribute.


setCollection

public void setCollection(boolean collection)
Set collection flag.


setContentLength

public void setContentLength(long contentLength)
Set content length.

Parameters:
contentLength - New content length value


setCreation

public void setCreation(long creation)
Set creation.

Parameters:
creation - New creation value


setCreationDate

public void setCreationDate(Date creationDate)
Creation date mutator.

Parameters:
creationDate - New creation date


setETag

public void setETag(String eTag)
Set strong ETag.


setLastModified

public void setLastModified(Date lastModified)

Deprecated.

Set last modified date.

Parameters:
lastModified - New last modified date value


setLastModified

public void setLastModified(long lastModified)
Set last modified.

Parameters:
lastModified - New last modified value


setLastModifiedDate

public void setLastModifiedDate(Date lastModifiedDate)
Last modified date mutator.

Parameters:
lastModifiedDate - New last modified date


setName

public void setName(String name)
Set name.

Parameters:
name - New name value


setResourceType

public void setResourceType(String resourceType)
Type mutator.

Parameters:
resourceType - New resource type


size

public int size()
Retrieves the number of attributes in the attribute set.


Copyright B) 2000-2003 Apache Software Foundation. All Rights Reserved.