org.apache.naming.resources

Class ResourceAttributes

public class ResourceAttributes extends Object implements Attributes

Attributes implementation.

Version: $Revision: 708151 $

Author: Remy Maucherat

Field Summary
static StringALTERNATE_CONTENT_LENGTH
Content length.
static StringALTERNATE_CREATION_DATE
Creation date.
static StringALTERNATE_ETAG
ETag.
static StringALTERNATE_LAST_MODIFIED
Last modification date.
static StringALTERNATE_TYPE
Type.
protected Attributesattributes
External attributes.
protected booleancollection
Collection flag.
protected longcontentLength
Content length.
protected longcreation
Creation time.
protected DatecreationDate
Creation date.
static StringCOLLECTION_TYPE
Collection type.
static StringCONTENT_LANGUAGE
Content language.
static StringCONTENT_LENGTH
Content length.
static StringCONTENT_TYPE
MIME type of the content.
static StringCREATION_DATE
Creation date.
static StringETAG
ETag.
protected static SimpleDateFormatformat
HTTP date format.
protected static SimpleDateFormat[]formats
Date formats using for Date parsing.
protected static TimeZonegmtZone
protected longlastModified
Last modified time.
protected DatelastModifiedDate
Last modified date.
protected StringlastModifiedHttp
Last modified date in HTTP format.
static StringLAST_MODIFIED
Last modification date.
protected StringmimeType
MIME type.
protected Stringname
Name.
static StringNAME
Name.
protected StringstrongETag
Strong ETag.
static StringSOURCE
Source.
static StringTYPE
Type.
protected StringweakETag
Weak ETag.
Constructor Summary
ResourceAttributes()
Default constructor.
ResourceAttributes(Attributes attributes)
Merges with another attribute set.
Method Summary
Objectclone()
Clone the attributes object (WARNING: fake cloning).
Attributeget(String attrID)
Get attribute.
NamingEnumerationgetAll()
Get all attributes.
StringgetCanonicalPath()
Return the canonical path of the resource, to possibly be used for direct file serving.
longgetContentLength()
Get content length.
longgetCreation()
Get creation time.
DategetCreationDate()
Get creation date.
StringgetETag()
Get ETag.
StringgetETag(boolean strong)
Get ETag.
NamingEnumerationgetIDs()
Get all attribute IDs.
longgetLastModified()
Get last modified time.
DategetLastModifiedDate()
Get lastModified date.
StringgetLastModifiedHttp()
StringgetMimeType()
StringgetName()
Get name.
StringgetResourceType()
Get resource type.
booleanisCaseIgnored()
Case sensitivity.
booleanisCollection()
Is collection.
Attributeput(Attribute attribute)
Put attribute.
Attributeput(String attrID, Object val)
Put attribute.
Attributeremove(String attrID)
Remove attribute.
voidsetCollection(boolean collection)
Set collection flag.
voidsetContentLength(long contentLength)
Set content length.
voidsetCreation(long creation)
Set creation.
voidsetCreationDate(Date creationDate)
Creation date mutator.
voidsetETag(String eTag)
Set strong ETag.
voidsetLastModified(long lastModified)
Set last modified.
voidsetLastModified(Date lastModified)
Set last modified date.
voidsetLastModifiedDate(Date lastModifiedDate)
Last modified date mutator.
voidsetLastModifiedHttp(String lastModifiedHttp)
voidsetMimeType(String mimeType)
voidsetName(String name)
Set name.
voidsetResourceType(String resourceType)
Type mutator.
intsize()
Retrieves the number of attributes in the attribute set.

Field Detail

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_ETAG

public static final String ALTERNATE_ETAG
ETag.

ALTERNATE_LAST_MODIFIED

public static final String ALTERNATE_LAST_MODIFIED
Last modification date.

ALTERNATE_TYPE

public static final String ALTERNATE_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.

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.

format

protected static final SimpleDateFormat format
HTTP date format.

formats

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

gmtZone

protected static final TimeZone gmtZone

lastModified

protected long lastModified
Last modified time.

lastModifiedDate

protected Date lastModifiedDate
Last modified date.

lastModifiedHttp

protected String lastModifiedHttp
Last modified date in HTTP format.

LAST_MODIFIED

public static final String LAST_MODIFIED
Last modification date.

mimeType

protected String mimeType
MIME type.

name

protected String name
Name.

NAME

public static final String NAME
Name.

strongETag

protected String strongETag
Strong ETag.

SOURCE

public static final String SOURCE
Source.

TYPE

public static final String TYPE
Type.

weakETag

protected String weakETag
Weak ETag.

Constructor Detail

ResourceAttributes

public ResourceAttributes()
Default constructor.

ResourceAttributes

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

Method Detail

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.

getCanonicalPath

public String getCanonicalPath()
Return the canonical path of the resource, to possibly be used for direct file serving. Implementations which support this should override it to return the file path.

Returns: The canonical path of the resource

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: strong ETag if available, else weak ETag.

getETag

public String getETag(boolean strong)

Deprecated:

Get ETag.

Parameters: strong Ignored

Returns: strong ETag if available, else weak 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

getLastModifiedHttp

public String getLastModifiedHttp()

Returns: Returns the lastModifiedHttp.

getMimeType

public String getMimeType()

Returns: Returns the mimeType.

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.

Parameters: collection New flag value

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(long lastModified)
Set last modified.

Parameters: lastModified New last modified value

setLastModified

public void setLastModified(Date lastModified)

Deprecated:

Set last modified date.

Parameters: lastModified New last modified date value

setLastModifiedDate

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

Parameters: lastModifiedDate New last modified date

setLastModifiedHttp

public void setLastModifiedHttp(String lastModifiedHttp)

Parameters: lastModifiedHttp The lastModifiedHttp to set.

setMimeType

public void setMimeType(String mimeType)

Parameters: mimeType The mimeType to set.

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 © 2000-2011 Apache Software Foundation. All Rights Reserved.