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:
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

