You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tika.apache.org by "Keith R. Bennett (JIRA)" <ji...@apache.org> on 2007/09/27 19:21:51 UTC

[jira] Updated: (TIKA-36) A convenience method for getting a document's content's text would be helpful.

     [ https://issues.apache.org/jira/browse/TIKA-36?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Keith R. Bennett updated TIKA-36:
---------------------------------

    Attachment: tika-36.patch

Simple patch adding the method:

    /**
     * Returns the text associated with the Content named 'name',
     * or null if such a Content does not exist.
     *
     * @param name name of Content the caller wants the value of
     * @return the found Content's value, or null if not found
     */
    public String getContentValue(String name) {
        Content content = getContent(name);

        return content != null
                ? content.getValue()
                : null;
    }


> A convenience method for getting a document's content's text would be helpful.
> ------------------------------------------------------------------------------
>
>                 Key: TIKA-36
>                 URL: https://issues.apache.org/jira/browse/TIKA-36
>             Project: Tika
>          Issue Type: New Feature
>          Components: general
>    Affects Versions: 0.1-incubator
>            Reporter: Keith R. Bennett
>            Priority: Minor
>             Fix For: 0.1-incubator
>
>         Attachments: tika-36.patch
>
>
> Currently, to get a parsed document's content value (e.g. title), one must do something like this:
>         Content content = getContent(name);
>         return content != null
>                 ? content.getValue()
>                 : null;
> I'd like to suggest we create a method that does that in one place, so that users do not need to do that themselves.
> Patch coming momentarily...

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.