commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Wooten <mwooten....@gmail.com>
Subject [IO] Magic Number File Filter
Date Fri, 07 Aug 2009 02:57:11 GMT
Hello Apache Development Community,

I would like to propose the following addition to the Commons IO project. I
created a file filter that could read "magic numbers", which are the bytes
(usually but not always at the beginning of a file) that identify a specific
file format. For instance, the Java class file format uses 0xCAFEBABE to
identify class files. The features of this filter are that it will accept
files that contain a magic number either at the beginning of the file or at
a specified offset. The magic number can be supplied to the filter as either
a String or a byte array.

I created a JIRA post for the feature. The post includes a patch with an
implementation of the filter, as well as test cases, and an updated version
of FileFilterUtils that contains utility methods for creating instances of
the filter.

If you are interested in including this feature, the JIRA posting is at
https://issues.apache.org/jira/browse/IO-210 .

I also have a JIRA posting for a feature that adds methods to
FileFilterUtils to apply filters to Lists, Maps, and Sets. There is a patch
with the code changes and test cases included. If you are interested in
including that feature, please see the JIRA posting at
https://issues.apache.org/jira/browse/IO-198 .

I would love feedback on either of these features.

Thank you.

-Michael Wooten

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message