mime-util 2.0 Released


News: mime-util 2.0 Released

  1. mime-util 2.0 Released (5 messages)

    We are pleased to announce the release of mime-util 2.0 and it's new web site at http://www.medsea.eu/mime-util. This is a major upgrade to the previous 1.3 release. There are many changes to the mime-util core, some of which are not backward compatible with previous releases. Most notably here is the removal of the static initialisation blocks from the MimeDetector(s). This means that your code will now have to specifically register the MimeDetector(s) you wish to use, using their fully qualified class names as in MimeUtil.registerMimeDetector(“eu.medsea.mimeutil.detector.ExtensionMimeDetector�);. The only exception to the rule above, is the new TextMimeDetector, this is registered by default and cannot be de-registered. However, it is effectively disabled out-of-the-box. This new MimeDetector is capable of analysing text content from all of the supported sources and creates instances of TextMimeType that extend the eu.medsea.mimeutil.MimeType adding an encoding attribute. This MimeDetector uses a new utility class eu.medsea.util.EncodingGuesser to assist in the detection and can be used standalone in your applications if needed. You can read how to configure the TextMimeDetector with encodings and custom handlers at http://www.medsea.eu/mime-util/detectors.html. Other changes include the removal of all depricated classes and methods, a change of logging dependency from commons-logging to SLF4J and addition meta-data added to the jar manifest file enabling mime-util to be deployed as an OSGi bundle in an OSGi container such as Equinox and Knopflerfish. We would suggest upgrading projects using mime-util 1.x to this new release ASAP as we have some more exciting stuff in the pipe line and we do not foresee any changes to the 2.0 public API in the near future. See the web sites “Whats Next?� link for more details regarding upcoming features and enhancements. Regards Steven McArdle

    Threaded Messages (5)

  2. Hey Steven; This looks really good, based on a quick look through the docs an API. I particularly like the idea of being able to determine a mime type from a byte array. If I understand the API correctly, if I have a byte array in Java, I can call MagicMimeMimeDetector and it [might] tell me that the byte array is a GIF, or XML or perhaps even a serialized Java class. Is that approximately correct ? //Nicholas
  3. Hi Nicholas, That's exactly correct. As long as the magic.mime files have rules to identify the type then it will be detected. If the magic.mime files on your system do not have magic rules for the type you are after, you can always add your own to one of the locations identified in the JavaDoc for the MagicMimeMimeDetector. It may be worth looking at the web page http://www.medsea.eu/mime-util/detectors.html for the MimeDetector(s) which give a slightly more "human" readable description of the MimeDetector(s) supported by mime-util "out-of-the-box" Regards Steven McArdle
  4. gae/j friendly?[ Go to top ]

    I had considered a previous version of mime-util, but became discouraged as I needed to run this in google app engine for java. Have you tested this against the gae/j sandbox? If so, a quick gotcha page would be useful.
  5. gae/j friendly?[ Go to top ]

    Hi Adrian, The answer to your question is no we haven't. However, because of your comment I have raised an internal ticket for support and we will see what we can do for the mime-util 2.1 release in about a weeks time. For your information the 2.1 release will fix a minor bug with the collection type returned from the MimeUtil.getMimeTypes(URL url) method. Additional functionality has been added to the getMimeType(URL url) method enabling mime-util to detect MIME types directly from the entries in Zip and Jar files using the existing MimeDetector(S). We will also release a new MimeDetector which can get the "Content Type" associated with a file extension from the Windows Registry. We would like mime-util to be a "one-stop-shop" for MIME detection and to help us achieve this we rely on people, such as yourself, to provide us with feedback regarding problems in different environments and or use cases. We do hope you will give mime-util another try, and most of all we would like your feedback on your problems while trying to run mime-util in your particular environment. We will always do our best to resolve issues. Best Regards Steven McArdle
  6. 2.1 and gae/j[ Go to top ]

    Thanks for being so attentive! I'll keep an eye out for 2.1, and love to use it, if it pans out. -Adrian jclouds