Extraction of Metadata from an image file using Tika library in a Pega function

I have learned a new java library called  “Tika” and this is an open source used to detect the language, MIME detection, Parsing of data, extraction of metadata. This library has 3 jars mainly used to support various functionalities from Tika mentioned below. For more details, you can google it.
1) org.apache.tika.jar
2) tika-core-1.6.jar
3) tika-parsers-1.6.jar

Brief idea on Tika library and the features:


















Extract the metadata from an image file stored in the server path (ServiceExport) in my V84 PE:
Wrote a simple java code in the Pega function to get the file name (Car.jpg) from an activity call to return the metadata using Tika library logic. The function returns a String of all the metadata associated to that image file. For now, I showed that metadata in a Show-Property method from the activity call. To perform this whole exercise, I have installed all the Tika jars in my PE before I start this exercise.





















Note: There might be other alternative ways to extract the metadata but I like this approach.

References:
3) Pega Developer Help

Popular posts from this blog

Connecting Claude to Pega Infinity 25.1.3 via MCP — Step-by-Step

Build Pega Applications with GitHub Copilot CLI, Pega Infinity AI Plugin & MCP — Branch-Based Agentic Authoring

itextpdf API to generate PDF doc from an image file using Pega PE