Asset getMetadata() returns Object Array instead of String
Hi,
I'm trying to pull the meta data (namely the 'dc:description' and 'dc:title') off of an DAM Asset:
ResourceResolver resourceResolver = slingRequest.getResourceResolver(); Resource res = resourceResolver.getResource(imagePath); Asset asset = res.adaptTo(Asset.class); // this is empty: asset.getMetadataValue("dc:description") // this returns [Ljava.lang.Object;@4281a636 asset.getMetadata("dc:description").toString() // doing this returns all metadata, do I can see that dc:description does exist:asset.getMetadata()
/* {dam:Progressive=no, dam:sha1=60dcef16fc38f6d96240bf91edd05f05608bf9fd, dam:Physicalwidthindpi=-1, stRef:instanceID=xmp.iid:D7BC5564CF9D11E2A8C9A7B002094D24, dam:MIMEtype=image/png, stRef:documentID=xmp.did:D7BC5565CF9D11E2A8C9A7B002094D24, dc:description=[Ljava.lang.Object;@4281a636, xmpMM:InstanceID=xmp.iid:D7BC5566CF9D11E2A8C9A7B002094D24, dam:Fileformat=PNG, tiff:ImageLength=114, dam:extracted=2014-01-23T10:00:12.333-08:00, dc:format=image/png, tiff:ImageWidth=114, xml:lang=x-default, dam:Comments=Pauls test comment, xmp:CreatorTool=Adobe Photoshop CS6 (Windows), dam:Physicalheightindpi=-1, dc:title=[Ljava.lang.Object;@4dc74556, dam:size=2468, xmpMM:DocumentID=xmp.did:D7BC5567CF9D11E2A8C9A7B002094D24, dam:Physicalheightininches=-1.0, dam:Numberofimages=1, dam:Numberoftextualcomments=2, dam:Physicalwidthininches=-1.0, dam:Bitsperpixel=32, dc:modified=2014-01-28T15:17:29.996-08:00} */
I'm just wondering what I'm doing wrong. My understanding was that 'getMetadataValue' returns the string value. If that's not true for objects, how do I get the string off of asset.getMetadata("dc:description")?
Thanks,
Paul