I don't use a URI.

Here is my code from my JSP mime extractor

        ApertureRuntime aperture = new ApertureRuntime();

        String filename = request.getParameter("filename");

        RDFContainer container = aperture.extractFrom(new File(filename));

        System.out.println("FILENAME: "+filename);
        String mime = aperture.identifyMimeType(new FileInputStream(filename), "");
        out.println(mime);

filename=anything.odt
mime=application/zip

Darren

On Tue, 2010-04-13 at 14:56 +0200, Antoni Mylka wrote:
I remember we had some issues with the extension of the file not being 
properly extracted in cases like

http://www.mywebsite.com/somefile.doc?param1=val1&param2=val2

or

zip:mime:file:///somefile.eml!/1!/insidezip/file.doc

If you see that you do pass the uris to the identifier, they do contain 
the extension, but the extension is not recognized - please post some 
examples.

Antoni Mylka
antoni.mylka@gmail.com

W dniu 2010-04-13 14:11, Darren Govoni pisze:
> But I am passing in the extension in the file name. It is already on the
> filesystem as paper.odt.
>
> I will try it again and see though.
>
> On Tue, 2010-04-13 at 12:41 +0200, Antoni Mylka wrote:
>> This has been discussed for a long while. Soon we'll be able to
>> celebrate the 2nd birthday of issue 2210328:
>>
>> https://sourceforge.net/tracker/?func=detail&aid=2210328&group_id=150969&atid=779503  <https://sourceforge.net/tracker/?func=detail&aid=2210328&group_id=150969&atid=779503>
>>
>> Basically the mime type identifier could require some bigger buffer, so
>> that if the file is a zip, it could extract the name of the first zip
>> entry, or some initial bytes of the first zip entry. It should be enough
>> to distinguish a docx from an odt.
>>
>> Antoni
>>
>> W dniu 2010-04-13 12:00, Christiaan Fluit pisze:
>> >  I think this means that you are not passing the file name or URI with a
>> >  file extension to the MIME type identifier. The MagicMimeTypeIdentifier
>> >  uses the file extension to distinguish OpenOffice files from ZIP files.
>> >
>> >  Regards,
>> >  Chris
>> >
>> >  Darren Govoni wrote:
>> >>  Hi,
>> >>     I am also noticing that OpenOffice .odt files are being recognized as
>> >>  application/zip. Perhaps this is because they might be,
>> >>  but Aperture needs to coerce the underlying format in favor of the
>> >>  ostensible type (e.g. application/vnd.oasis.opendocument.text )
>> >>  otherwise, some useful processing gets missed in user apps (like mine). :)
>> >>
>> >>  Darren
>> >>
>> >>  On Wed, 2010-04-07 at 14:26 +0200, Leo Sauermann wrote:
>> >>>  Hi Brian,
>> >>>
>> >>>  Can you make a patch for this and write a mail to the mailinglist?
>> >>>
>> >>>  As a matter of fact, I also forward it to the list also, in your name,
>> >>>  But I guess you know more about the actual problem.
>> >>>
>> >>>
>> >>>  As most open source projects, we have a policy that you join the project after submitting a few patches successfully, which you, as a professional in the area, probably understand.
>> >>>  See here:
>> >>>  http://sourceforge.net/apps/trac/aperture/wiki/GettingInvolved
>> >>>
>> >>>  best
>> >>>  Leo Sauermann
>> >>>
>> >>>
>> >>>>  -----Ursprüngliche Nachricht-----
>> >>>>  Von: Brian Eubanks [mailto:iuban@users.sourceforge.net]
>> >>>>  Gesendet: Dienstag, 6. April 2010 16:03
>> >>>>  An:leo_sauermann@users.sourceforge.net  <mailto:leo_sauermann@users.sourceforge.net><mailto:leo_sauermann@users.sourceforge.net>
>> >>>>  Cc:iuban@users.sourceforge.net  <mailto:iuban@users.sourceforge.net><mailto:iuban@users.sourceforge.net>
>> >>>>  Betreff: Aperture project
>> >>>>
>> >>>>
>> >>>>  Message body follows:
>> >>>>
>> >>>>  I would like to join the Aperture project. My user name is
>> >>>>  iuban.
>> >>>>
>> >>>>  I would like to make a change to mimetypes.xml. In crawling
>> >>>>  some maildir files, the messages are not being recognized as
>> >>>>  rfc822. This happens when the Message-ID header occurs
>> >>>>  first. The fix is to add
>> >>>>  <magicNumber encoding="string">Message-ID:</magicNumber>
>> >>>>  before the Return-Path entry.
>> >>>>
>> >>>>  Regards,
>> >>>>  Brian Eubanks
>> >>>>  Washington Semantic Web Meetup
>>
>>
>> ------------------------------------------------------------------------------
>> Download Intel&#174; Parallel Studio Eval
>> Try the new software tools for yourself. Speed compiling, find bugs
>> proactively, and fine-tune applications for parallel performance.
>> See why Intel Parallel Studio got high marks during beta.
>> http://p.sf.net/sfu/intel-sw-dev
>> _______________________________________________
>> Aperture-devel mailing list
>> Aperture-devel@lists.sourceforge.net  <mailto:Aperture-devel@lists.sourceforge.net>
>> https://lists.sourceforge.net/lists/listinfo/aperture-devel
>


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Aperture-devel mailing list
Aperture-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/aperture-devel