From dev-return-115778-apmail-commons-dev-archive=commons.apache.org@commons.apache.org Fri Aug 07 02:57:35 2009 Return-Path: Delivered-To: apmail-commons-dev-archive@www.apache.org Received: (qmail 4103 invoked from network); 7 Aug 2009 02:57:34 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 7 Aug 2009 02:57:34 -0000 Received: (qmail 36173 invoked by uid 500); 7 Aug 2009 02:57:41 -0000 Delivered-To: apmail-commons-dev-archive@commons.apache.org Received: (qmail 36037 invoked by uid 500); 7 Aug 2009 02:57:41 -0000 Mailing-List: contact dev-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Developers List" Delivered-To: mailing list dev@commons.apache.org Received: (qmail 36027 invoked by uid 99); 7 Aug 2009 02:57:41 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Aug 2009 02:57:41 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of mwooten.dev@gmail.com designates 74.125.78.149 as permitted sender) Received: from [74.125.78.149] (HELO ey-out-1920.google.com) (74.125.78.149) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Aug 2009 02:57:31 +0000 Received: by ey-out-1920.google.com with SMTP id 13so414285eye.60 for ; Thu, 06 Aug 2009 19:57:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=tuAWBPh6vBE85JRA2EM/9IJR116+/X67G5gUt03B6GM=; b=VgpTtD8FFeD1swr1xB/uZeXGWxLFZMqZtymCHFh6yuV+CE2zsfhE4OzYnY8oXvUW2y kCr7yy1rN/+ELiq5PQGGaRCylD7aaPHvOm3VqWdrpVtALjSY1IovSvg6OsOqr6pLt7aZ llQ3/9ddNmWm5VqF/3jnPhebICQdO+hpnfgeA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=Rh20pycoSZTVNfNvbA2qf6+j9nJMr5wGBl1eWoODgPp1+ofVMktRxww+u6kw/V7xPD hLsos0RxqFJHrnRqhj6TYHVhRaYbGxAbqFbRW0hQSasfcO5QezcvJKVex82eS0PKxnOd Dwa9dVBE/r+tkRE//Nddutiikhk8XWEGmRupE= MIME-Version: 1.0 Received: by 10.210.53.1 with SMTP id b1mr315131eba.20.1249613831562; Thu, 06 Aug 2009 19:57:11 -0700 (PDT) Date: Thu, 6 Aug 2009 22:57:11 -0400 Message-ID: Subject: [IO] Magic Number File Filter From: Michael Wooten To: Commons Developers List Content-Type: multipart/alternative; boundary=0015174c3f0a8967e7047084646e X-Virus-Checked: Checked by ClamAV on apache.org --0015174c3f0a8967e7047084646e Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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 --0015174c3f0a8967e7047084646e--