tika-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ken Krugler (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (TIKA-653) Can't detected MimeType from FileInputStream
Date Tue, 03 May 2011 13:38:03 GMT

    [ https://issues.apache.org/jira/browse/TIKA-653?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13028223#comment-13028223
] 

Ken Krugler commented on TIKA-653:
----------------------------------

Hi Sascha,

One side comment - it's usually best to post questions about possible bugs to the list first.
Then, if the result of investigation indicates a bug, you can file an issue in Jira.

E.g. for this particular problem, I imagine the next step would be for you to provide the
file so others could try to process it on their machines. This would rule out a problem with
your particular environment.

Regards,

-- Ken

> Can't detected MimeType from FileInputStream
> --------------------------------------------
>
>                 Key: TIKA-653
>                 URL: https://issues.apache.org/jira/browse/TIKA-653
>             Project: Tika
>          Issue Type: Bug
>    Affects Versions: 0.9
>            Reporter: Sascha Rodekamp
>
> Hi,
> i have a problem with the detection of the mime type from an file input stream.
> It always throws an IO Exception. I tried to wrap the FileInputStream in a BufferedInputStream
because the BIS but it doesn't help. Here the Stack Trace:
> {code}
> Exception: java.io.IOException
> Message: Read error
> ---- stack trace ---------------------------------------------------------------
> java.io.IOException: Read error
> java.io.FileInputStream.readBytes(Native Method)
> java.io.FileInputStream.read(FileInputStream.java:199)
> java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
> java.io.BufferedInputStream.read1(BufferedInputStream.java:258)
> java.io.BufferedInputStream.read(BufferedInputStream.java:317)
> java.io.FilterInputStream.read(FilterInputStream.java:90)
> org.apache.tika.mime.MimeTypes.readMagicHeader(MimeTypes.java:300)
> org.apache.tika.mime.MimeTypes.detect(MimeTypes.java:535)
> org.apache.tika.Tika.detect(Tika.java:132)
> org.apache.tika.Tika.detect(Tika.java:155)
> {code}
> It works great with a ByteArrayInputStream.
> MyCode to get the MimeType from the InputStream is:
> {code}
> if (!is.markSupported()) {
>         	is = new BufferedInputStream(is);
>         }
>     	Tika tika = new Tika();
>         try {
> 	        return tika.detect(is);
>         }
>         .....
> {code}
> Is this a bug in the library or my fault?
> any help would be great:)

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message