mk.fsgrep.find
Class TextFileFilter

java.lang.Object
  extended by mk.fsgrep.find.TextFileFilter
All Implemented Interfaces:
java.io.FilenameFilter

public class TextFileFilter
extends java.lang.Object
implements java.io.FilenameFilter

Determine whether the given file is a text file, and accept it if it is. This is done by reading the first 8 bytes of the file and seeing if they are valid text characters by checking if they fall withing the range [1, 255]. This only works for single-byte character sets.

Author:
Murali Krishnan

Constructor Summary
TextFileFilter()
           
 
Method Summary
 boolean accept(java.io.File dir, java.lang.String name)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextFileFilter

public TextFileFilter()
Method Detail

accept

public boolean accept(java.io.File dir,
                      java.lang.String name)
Specified by:
accept in interface java.io.FilenameFilter


Copyright © 2009. All Rights Reserved.