Note that there are some explanatory texts on larger screens.

plurals
  1. POExtracting Metadata using Apache Tika and Storing into HashMap
    primarykey
    data
    text
    <p>I am trying to extract metadata using apache tika and then putting into HashMap.. But my code get's only the key not the value of that key.. For Example.. It stores only title(as a key) but not its value, in the same way it store keywords(as a key) but not its value..<br> And if i try to see what does <strong>md</strong> contains, its shows this:-</p> <pre><code>Description= title=Wireless Technology &amp; Innovation | Mobile Technology Content-Encoding=UTF-8 Content-Type=text/html; charset=utf-8 Keywords= google-site-verification=AzhlXdqBSdUCRPJRY1evCtp2Ko5r9kxB_f81WffACUc </code></pre> <hr> <pre><code> private Map&lt;String, String&gt; metaData; try { Metadata md = new Metadata(); htmlStream = new ByteArrayInputStream(htmlContent.getBytes()); String parsedText = tika.parseToString(htmlStream, md); //very unlikely to happen if (text == null){ text = parsedText.trim(); } processMetaData(md); } catch (Exception e) { e.printStackTrace(); } finally { IOUtils.closeQuietly(htmlStream); } private void processMetaData(Metadata md){ if ((getMetaData() == null) || (!getMetaData().isEmpty())) { setMetaData(new HashMap&lt;String, String&gt;()); } for (String name : md.names()){ //This below line is not working I guess, it stores only the key.. not the value of that particular key.. getMetaData().put(name.toLowerCase(), md.get(name)); } } public Map&lt;String, String&gt; getMetaData() { return metaData; } public void setMetaData(Map&lt;String, String&gt; metaData) { this.metaData = metaData; } </code></pre> <p>Any help will be appreciated..</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload