filetypedetect


determine file type with magic test

Important announcement: I'm looking for a new maintainer!

Due to lack of time, I've decided to dismiss this project. If you're interested, you may become the new maintainer. Please contact me to c(dot)cerbo(at)gmail(dot)com and I'll give you the commit right for the svn repository.


This project is an effort to port to Java the file utility for detecting the type of a file.

You can help reporting and attaching files that aren't correctly detected in the Issues section.

In order to develop a similar tool a set of test files is essential. The files currently used to test are committed in our svn repository in the folder trunk/FileTypeDetect/testfiles and its subfolder.

Currently we use the magic file released with the version 5.03 of the file utility. The format of the magic file is documented here.

Here are some usage examples: ``` $ java -jar filetypedetect_x.x.jar ~/Video/Flash005.swf Macromedia Flash data (compressed), version 6;application/x-shockwave-flash

$ java -jar dist/filetypedetect_x.x.jar ~/Immagini/fedora-eclipse.png PNG image, 48 x 48, 8-bit/color RGBA, non-interlaced;image/png ```

and this is the complete usage information: ``` Usage: filetypedetect [-hv] [MAGIC FILE] FILE

Determine type of FILEs.

Options: -h, --help Show this help message and exit -v, --version Show the program version and exit MAGIC FILE Use this magic file FILE File whose type is to detect

Examples: filetypedetect ~/Video/Flash005.swf filetypedetect /usr/share/magic ~/Video/Flash005.swf ```

Project Information

Labels:
java linux