WEB4J Development Tools 4.10.0.0

hirondelle.web4jtools.metrics.base
Class FileInfo

Object
  extended by hirondelle.web4jtools.metrics.base.FileInfo

public final class FileInfo
extends Object

Model Object for basic File Information.


Constructor Summary
FileInfo(File aFile)
          Full constructor.
 
Method Summary
 boolean equals(Object aThat)
           
 String getContent()
          Return the contents of the file as a single String (source files only).
 SafeText getExtension()
          Return the file extension.
static String getIgnorableFiles()
          Returned the list of ignorable files, as configured in web.xml.
static String getImageFileExtensions()
          Return the list of extensions for image files, as configured in web.xml.
 Date getLastModified()
          Return the date the file was last modified.
static String getMarkupFileExtensions()
          Return the list of extensions for markup files, as configured in web.xml.
 SafeText getName()
          Return the absolute path name of the file.
 Integer getNumCommentLines()
          Return the number of comments (java files only)
 Integer getNumLines()
          Return the number of lines (source files only)
 Integer getNumTabs()
          Return the number of tab characters (source files only).
 Integer getPercentComments()
          Return the percentage of comments as part of total lines (java files only)
 SafeText getSimpleName()
          Return the simple name of the file, without path information.
 Long getSize()
          Return the size of the file in bytes.
static String getSourceFileExtensions()
          Return the list of extensions for source files, as configured in web.xml.
 String getSpecification()
          Return the name and version of a .jar file's specification (.jar files only).
 int hashCode()
           
static boolean isIgnorable(File aFile)
          Determine if a file is an 'ignorable' file (such as a .class file, for instance.) See getIgnorableFiles().
 Boolean isImageFile()
          Return true only if the extension matches one of the image file extensions configured in web.xml.
 Boolean isJarFile()
          Return true only if the file extension is '.jar'
 Boolean isJavaClassFile()
          Return true only if the file extension is '.class'
 Boolean isJavaSourceFile()
          Return true only if the file extension is '.java'
 Boolean isMarkupFile()
          Return true only if the extension matches one of the markup file extensions configured in web.xml.
 Boolean isSourceFile()
          Return true only if the extension matches one of the source file extensions configured in web.xml.
 Boolean isUnitTest()
          Return true only if the file contains idenifier text configured in web.xml (java files only).
static void readConfig(ServletConfig aConfig)
          Read in config from web.xml.
 String toString()
           
 
Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FileInfo

public FileInfo(File aFile)
Full constructor.

Method Detail

readConfig

public static void readConfig(ServletConfig aConfig)
Read in config from web.xml.

Called only during startup.


getIgnorableFiles

public static String getIgnorableFiles()
Returned the list of ignorable files, as configured in web.xml.


getSourceFileExtensions

public static String getSourceFileExtensions()
Return the list of extensions for source files, as configured in web.xml.


getImageFileExtensions

public static String getImageFileExtensions()
Return the list of extensions for image files, as configured in web.xml.


getMarkupFileExtensions

public static String getMarkupFileExtensions()
Return the list of extensions for markup files, as configured in web.xml.


isIgnorable

public static boolean isIgnorable(File aFile)
Determine if a file is an 'ignorable' file (such as a .class file, for instance.) See getIgnorableFiles().


getName

public SafeText getName()
Return the absolute path name of the file.


getSimpleName

public SafeText getSimpleName()
Return the simple name of the file, without path information.


getSize

public Long getSize()
Return the size of the file in bytes.


getLastModified

public Date getLastModified()
Return the date the file was last modified.


getExtension

public SafeText getExtension()
Return the file extension.


isSourceFile

public Boolean isSourceFile()
Return true only if the extension matches one of the source file extensions configured in web.xml. See getSourceFileExtensions().


isImageFile

public Boolean isImageFile()
Return true only if the extension matches one of the image file extensions configured in web.xml. See getImageFileExtensions().


isMarkupFile

public Boolean isMarkupFile()
Return true only if the extension matches one of the markup file extensions configured in web.xml. See getMarkupFileExtensions().


isJavaSourceFile

public Boolean isJavaSourceFile()
Return true only if the file extension is '.java'


isJavaClassFile

public Boolean isJavaClassFile()
Return true only if the file extension is '.class'


isJarFile

public Boolean isJarFile()
Return true only if the file extension is '.jar'


getNumLines

public Integer getNumLines()
Return the number of lines (source files only)


getNumCommentLines

public Integer getNumCommentLines()
Return the number of comments (java files only)


getPercentComments

public Integer getPercentComments()
Return the percentage of comments as part of total lines (java files only)


isUnitTest

public Boolean isUnitTest()
Return true only if the file contains idenifier text configured in web.xml (java files only).


getSpecification

public String getSpecification()
Return the name and version of a .jar file's specification (.jar files only).


getNumTabs

public Integer getNumTabs()
Return the number of tab characters (source files only).


getContent

public String getContent()
Return the contents of the file as a single String (source files only).


toString

public String toString()
Overrides:
toString in class Object

equals

public boolean equals(Object aThat)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

WEB4J Development Tools 4.10.0.0

Copyright Hirondelle Systems - Generated 2013Oct19.12.26