I just added a download section where I’ll be adding various utilities and libraries I’ve written or will write in the course of things. Right now I’m working on a new project “Black Friar” (there is a link up, but no content there yet), and as part of that I needed to use the unix file program / libmagic to identify file types. Alas file / libmagic are written in C and only provide a python binding. I went ahead and hammered out a Java Native Interface (JNI) wrapper for the library and wrote a small (very small, as in one class) library to allow libmagic’s functions to be used in java.
The download includes compiled versions of the libmagic library and the jni file for linux. I did not compile a windows one because I don’t have a windows environment currently setup for compiling c, but the source code is included and can be used to generate such. The library is released under the LGPL whose text is included:
JFileMagic 1.0 - 308.25 KB