* This implementation delegates to the platform's content description support,
*/
@Override
public Map<String, Object> contentDescription(URI uri, InputStream inputStream, Map<?, ?> options, Map<Object, Object> context) throws IOException
{
IContentDescription contentDescription;
if (uri.isPlatformResource() && PlatformResourceURIHandlerImpl.workspaceRoot != null)
{
contentDescription = PlatformResourceURIHandlerImpl.WorkbenchHelper.getContentDescription(uri.toPlatformString(true), options);
}
else
{
contentDescription = Platform.getContentTypeManager().getDescriptionFor(inputStream, uri.lastSegment(), IContentDescription.ALL);
}
if (contentDescription == null)
{
return INVALID_CONTENT_DESCRIPTION;
}
else
{
Map<String, Object> result = createContentDescription(ContentHandler.Validity.VALID);
result.put(ContentHandler.CONTENT_TYPE_PROPERTY, contentDescription.getContentType().getId());
Set<String> requestedProperties = getRequestedProperties(options);
if (requestedProperties != null)
{
for (String property : requestedProperties)
{
QualifiedName qualifiedName = getQualifiedName(property);
if (qualifiedName != null)
{
Object value = getDescriptionValue(qualifiedName, contentDescription.getProperty(qualifiedName));
if (value != null)
{
result.put(property, value);
}
}