public Attribute get(String attrID) {
if (attributes == null) {
if (attrID.equals(CREATION_DATE)) {
Date creationDate = getCreationDate();
if (creationDate == null) return null;
return new BasicAttribute(CREATION_DATE, creationDate);
} else if (attrID.equals(ALTERNATE_CREATION_DATE)) {
Date creationDate = getCreationDate();
if (creationDate == null) return null;
return new BasicAttribute(ALTERNATE_CREATION_DATE, creationDate);
} else if (attrID.equals(LAST_MODIFIED)) {
Date lastModifiedDate = getLastModifiedDate();
if (lastModifiedDate == null) return null;
return new BasicAttribute(LAST_MODIFIED, lastModifiedDate);
} else if (attrID.equals(ALTERNATE_LAST_MODIFIED)) {
Date lastModifiedDate = getLastModifiedDate();
if (lastModifiedDate == null) return null;
return new BasicAttribute(ALTERNATE_LAST_MODIFIED, lastModifiedDate);
} else if (attrID.equals(NAME)) {
String name = getName();
if (name == null) return null;
return new BasicAttribute(NAME, name);
} else if (attrID.equals(TYPE)) {
String resourceType = getResourceType();
if (resourceType == null) return null;
return new BasicAttribute(TYPE, resourceType);
} else if (attrID.equals(ALTERNATE_TYPE)) {
String resourceType = getResourceType();
if (resourceType == null) return null;
return new BasicAttribute(ALTERNATE_TYPE, resourceType);
} else if (attrID.equals(CONTENT_LENGTH)) {
long contentLength = getContentLength();
if (contentLength < 0) return null;
return new BasicAttribute(CONTENT_LENGTH, new Long(contentLength));
} else if (attrID.equals(ALTERNATE_CONTENT_LENGTH)) {
long contentLength = getContentLength();
if (contentLength < 0) return null;
return new BasicAttribute(ALTERNATE_CONTENT_LENGTH, new Long(contentLength));
}
} else {
return attributes.get(attrID);
}
return null;