On Mon, May 19, 2008 at 1:05 PM, Yves Zoundi <[EMAIL PROTECTED]> wrote: > Hi everybody, > > It would be nice to create sub-projects from Apache Tika main maven > project. The mime detection part is pretty useful and its code could be > in a separate project. That would allow people to use it without the > rest of the Tika's code.
i'm keen on using the MIME magic in RAT as well > I was looking at a mime detection solution. I looked at JMimeInfo, > jmimemagic and mime-util. After few tests, I choose to use Apache Tika's > code. > > I removed few classes from the source code and created a jar with the > mime detection code. I needed to use Tika in an OSGI environment and it > was a bit painful to use Tika out of the box(without embedding it in an > OSGI bundle which would export Tika packages later). > > I had to create a manifest and as Tika's code is not huge, I was able to > export the packages quickly. I need to import javax.xml.parsers, sax and > dom packages as Tika use them to load the mimetypes configuration file. > > The thing I didn't see in the mime detection code was a serializer to > save the mimetypes. > > In a typical application, people usually : > - Want a mime type configuration file somewhere that they can load > - Want to be able to add/remove mimetypes > - Add file extensions patterns to existing mime types > - Store back the mime types to its location. not sure whether this is really a core activity. IMHO this would work better as a bolt-on. > So my questions are : > - If I load the mimetypes from a file, and add some mimetype entries at > runtime, how can I save back the file without doing it manually with > dom, jdom or dom4j? > - Would it be possible to create an OSGI bundle for the mime detection > library? submit a patch ;-) - robert