Public Member Functions | Static Public Member Functions

LinkChecker Class Reference

Inheritance diagram for LinkChecker:
LinkListener

List of all members.

Public Member Functions

 LinkChecker (String document)
boolean checkLinkRules (String fName, int line)
void doCheck () throws IOException
void error (String err, int line)
void hrefReference (String target, int line)
void imageReference (String imageFileName, int line)

Static Public Member Functions

static boolean fileAbsolute (String path)
static String fileMinusPath (String f)
static String fileMinusPathLocal (String f)
static boolean fileProtocolURL (String target)
static String getParent (String path)
static boolean imageLinkIsOk (String file) throws IOException
static String offensivePathMember (String fName)
static String pathMinusFile (String f)
static void visit (String file) throws IOException
static boolean visited (String file) throws IOException
static void visitImage (String file) throws IOException

Constructor & Destructor Documentation

LinkChecker.LinkChecker ( String  document  ) 

References pathMinusFile().

Referenced by hrefReference().


Member Function Documentation

boolean LinkChecker.checkLinkRules ( String  fName,
int  line 
)
void LinkChecker.doCheck (  )  throws IOException

References error(), and visit().

Referenced by hrefReference(), and Main.main().

void LinkChecker.error ( String  err,
int  line 
)
static boolean LinkChecker.fileAbsolute ( String  path  )  [static]

Referenced by getParent().

static String LinkChecker.fileMinusPath ( String  f  )  [static]

Return file from end of HTML path; i.e., use '/' separator

Referenced by offensivePathMember().

static String LinkChecker.fileMinusPathLocal ( String  f  )  [static]

Return file from end of locally correct path; i.e., use '/' or '\' separator

Referenced by checkLinkRules().

static boolean LinkChecker.fileProtocolURL ( String  target  )  [static]

Referenced by hrefReference().

static String LinkChecker.getParent ( String  path  )  [static]

References fileAbsolute().

Referenced by offensivePathMember().

void LinkChecker.hrefReference ( String  target,
int  line 
)
static boolean LinkChecker.imageLinkIsOk ( String  file  )  throws IOException [static]

Referenced by imageReference().

void LinkChecker.imageReference ( String  imageFileName,
int  line 
)
static String LinkChecker.offensivePathMember ( String  fName  )  [static]

Given a path to a file or dir, is the case of the reference the same as the actual path on the disk? This is only meaningful on a PC which is case-insensitive (not a real file system).

Returns null if there is nothing offensive and the file exists. Returns offending file/dir if it does not exist or it has there is a case mismatch for it. The last file is checked first followed by the parent directory, recursively, all the way to the absolute or relative path root in that String; i.e., we parse from right to left.

Because the File object won't actually go get the real filename from the disk so we can compare, we must get a directory listing of the directory and then look for the referenced file or dir. For example, for "./images/logo.gif" we would check "./images" dir listing for "logo.gif" with the appropriate case and then check directory "." for a dir called images with the right case. When no parent exists, we can stop looking for case problems.

References fileMinusPath(), and getParent().

Referenced by checkLinkRules().

static String LinkChecker.pathMinusFile ( String  f  )  [static]

Referenced by LinkChecker().

static void LinkChecker.visit ( String  file  )  throws IOException [static]

Referenced by doCheck().

static boolean LinkChecker.visited ( String  file  )  throws IOException [static]
static void LinkChecker.visitImage ( String  file  )  throws IOException [static]

Referenced by imageReference().


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations Properties