to.etc.util
Class FileContentInfo

java.lang.Object
  extended by to.etc.util.FileContentInfo

public class FileContentInfo
extends java.lang.Object

Helper class to determine a file's type (text, binary) and encoding (for text files). A file is marked as "binary" if it contains nulls and is not recognized as a text file. This will also determine a tab size either by scanning for defaults or by markers in the text.

Author:
Frits Jalvingh Created on Feb 21, 2010

Method Summary
static FileContentInfo createType(java.io.File src, java.lang.String name)
           
 java.lang.String getEncoding()
           
 java.lang.String getExtension()
           
 int getMaxLineSize()
           
 java.lang.String getName()
           
 int getNumHigh()
           
 int getNumLines()
           
 int getNumNonISO()
           
 int getNumNulls()
           
 int getNumUtf8()
           
 java.io.File getSource()
           
 int getTabSize()
           
 boolean isEncodingValid()
           
 boolean isText()
           
protected  void load()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createType

public static FileContentInfo createType(java.io.File src,
                                         java.lang.String name)
                                  throws java.lang.Exception
Throws:
java.lang.Exception

load

protected void load()
             throws java.lang.Exception
Throws:
java.lang.Exception

getSource

public java.io.File getSource()

getName

public java.lang.String getName()

getEncoding

public java.lang.String getEncoding()

isText

public boolean isText()

getExtension

public java.lang.String getExtension()

getTabSize

public int getTabSize()

getMaxLineSize

public int getMaxLineSize()

getNumNulls

public int getNumNulls()

getNumUtf8

public int getNumUtf8()

getNumNonISO

public int getNumNonISO()

getNumHigh

public int getNumHigh()

getNumLines

public int getNumLines()

isEncodingValid

public boolean isEncodingValid()