You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@tika.apache.org by "Yi, EungJun" <se...@gmail.com> on 2014/05/27 06:32:51 UTC

What exception does CharsetDetector.detect() throw?

Hi.

According to the javadoc of CharsetDetector.detect(), it raises an
exception if no charset appears to match the data:

     * Raise an exception if
     *  <ul>
     *    <li>no charsets appear to match the input data.</li>
     *    <li>no input text has been provided</li>
     *  </ul>

But it seems to me that the method returns null but does not raise an
exception. What exception does the method throw?

Thanks in advance.

Best Regards,
EungJun Yi

Re: What exception does CharsetDetector.detect() throw?

Posted by "Yi, EungJun" <se...@gmail.com>.
I have created one. Thanks!

Best Regards,
EungJun Yi


2014-05-30 1:34 GMT+09:00 Ken Krugler <kk...@transpac.com>:

> Hi there,
>
> I took a look, and from what I can tell you're correct - you get back null
> if there's no match. If no input is provided, then I think it also will
> return null - but the tests are pretty minimal.
>
> Please open an issue, thanks!
>
> -- Ken
>
> On May 26, 2014, at 9:32pm, "Yi, EungJun" <se...@gmail.com> wrote:
>
> Hi.
>
> According to the javadoc of CharsetDetector.detect(), it raises an
> exception if no charset appears to match the data:
>
>      * Raise an exception if
>      *  <ul>
>      *    <li>no charsets appear to match the input data.</li>
>      *    <li>no input text has been provided</li>
>      *  </ul>
>
> But it seems to me that the method returns null but does not raise an
> exception. What exception does the method throw?
>
> Thanks in advance.
>
> Best Regards,
> EungJun Yi
>
>
> --------------------------
> Ken Krugler
> +1 530-210-6378
> http://www.scaleunlimited.com
> custom big data solutions & training
> Hadoop, Cascading, Cassandra & Solr
>
>
>
>
>
>

Re: What exception does CharsetDetector.detect() throw?

Posted by Ken Krugler <kk...@transpac.com>.
Hi there,

I took a look, and from what I can tell you're correct - you get back null if there's no match. If no input is provided, then I think it also will return null - but the tests are pretty minimal.

Please open an issue, thanks!

-- Ken

On May 26, 2014, at 9:32pm, "Yi, EungJun" <se...@gmail.com> wrote:

> Hi.
> 
> According to the javadoc of CharsetDetector.detect(), it raises an
> exception if no charset appears to match the data:
> 
>      * Raise an exception if
>      *  <ul>
>      *    <li>no charsets appear to match the input data.</li>
>      *    <li>no input text has been provided</li>
>      *  </ul>
> 
> But it seems to me that the method returns null but does not raise an
> exception. What exception does the method throw?
> 
> Thanks in advance.
> 
> Best Regards,
> EungJun Yi
> 

--------------------------
Ken Krugler
+1 530-210-6378
http://www.scaleunlimited.com
custom big data solutions & training
Hadoop, Cascading, Cassandra & Solr