This documentation is part of the Link Checker Library project.

de.tw.website.linkchecker
Class DefaultWebSiteInfo

java.lang.Object
  |
  +--de.tw.website.linkchecker.DefaultWebSiteInfo
All Implemented Interfaces:
WebSiteInfo

public class DefaultWebSiteInfo
extends java.lang.Object
implements WebSiteInfo

Simple implementation of Interface WebSiteInfo. Functionality:

Version:
1.0
Author:
Thomas Weinbrenner

Constructor Summary
DefaultWebSiteInfo(java.lang.String urlRootDirectory, java.lang.String fileSystemRootDirectory)
          Constructor.
 
Method Summary
 java.lang.String getFileNameFromURL(java.lang.String url)
          Maps a URL to a file name.
 java.util.List getFileSystems()
          Returns a list of the topmost directories (as string) which are the file systems where the HTML-files are located.
 java.lang.String getURLFromFileName(java.lang.String fileName)
          Maps a file name to a URL.
 java.lang.String getURLFromJavaScriptCode(java.lang.String targetUrl)
          Extracts a URL reference from a javascript link.
 java.io.InputStream getUrlInputStream(java.lang.String url)
          Gets a InputStream for a URL.
 boolean isUrlOfTypeHTML(java.lang.String url)
          Information about a specific URL.
 java.lang.String shortenFileNameForDisplay(java.lang.String fileName)
          Strips the first part of the file name (for example the start directory) which is the same for all file names to reduce the size of the URLs in the reports.
 java.lang.String shortenUrlForDisplay(java.lang.String url)
          Strips the first part of the URL (for example the server name) which is the same for all URLs to reduce the size of the URLs in the reports.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultWebSiteInfo

public DefaultWebSiteInfo(java.lang.String urlRootDirectory,
                          java.lang.String fileSystemRootDirectory)
Constructor.
Method Detail

getURLFromFileName

public java.lang.String getURLFromFileName(java.lang.String fileName)
Description copied from interface: WebSiteInfo
Maps a file name to a URL.
Specified by:
getURLFromFileName in interface WebSiteInfo
See Also:
WebSiteInfo.getURLFromFileName(java.lang.String)

getFileNameFromURL

public java.lang.String getFileNameFromURL(java.lang.String url)
Description copied from interface: WebSiteInfo
Maps a URL to a file name.
Specified by:
getFileNameFromURL in interface WebSiteInfo
See Also:
WebSiteInfo.getFileNameFromURL(java.lang.String)

isUrlOfTypeHTML

public boolean isUrlOfTypeHTML(java.lang.String url)
Description copied from interface: WebSiteInfo
Information about a specific URL.
Specified by:
isUrlOfTypeHTML in interface WebSiteInfo
See Also:
WebSiteInfo.isUrlOfTypeHTML(java.lang.String)

getFileSystems

public java.util.List getFileSystems()
Description copied from interface: WebSiteInfo
Returns a list of the topmost directories (as string) which are the file systems where the HTML-files are located.
Specified by:
getFileSystems in interface WebSiteInfo
See Also:
WebSiteInfo.getFileSystems()

getURLFromJavaScriptCode

public java.lang.String getURLFromJavaScriptCode(java.lang.String targetUrl)
Description copied from interface: WebSiteInfo
Extracts a URL reference from a javascript link. In HTML there are links which contain javascript code, for example <A HREF="javascript:...">. In these cases it is possible that a URL is part of the javascript code, especially if the website uses frame technology. This is very website specific code.
Specified by:
getURLFromJavaScriptCode in interface WebSiteInfo
See Also:
WebSiteInfo.getURLFromJavaScriptCode(java.lang.String)

shortenUrlForDisplay

public java.lang.String shortenUrlForDisplay(java.lang.String url)
Description copied from interface: WebSiteInfo
Strips the first part of the URL (for example the server name) which is the same for all URLs to reduce the size of the URLs in the reports.
Specified by:
shortenUrlForDisplay in interface WebSiteInfo
See Also:
WebSiteInfo.shortenUrlForDisplay(java.lang.String)

shortenFileNameForDisplay

public java.lang.String shortenFileNameForDisplay(java.lang.String fileName)
Description copied from interface: WebSiteInfo
Strips the first part of the file name (for example the start directory) which is the same for all file names to reduce the size of the URLs in the reports.
Specified by:
shortenFileNameForDisplay in interface WebSiteInfo
See Also:
WebSiteInfo.shortenFileNameForDisplay(java.lang.String)

getUrlInputStream

public java.io.InputStream getUrlInputStream(java.lang.String url)
                                      throws java.lang.Exception
Description copied from interface: WebSiteInfo
Gets a InputStream for a URL. A straight-forward implementation would use a HTTP-Connection to get the content, but if there is no web-server running, it is also possible to retrieve the content from the file system.
Specified by:
getUrlInputStream in interface WebSiteInfo
See Also:
WebSiteInfo.getUrlInputStream(String)

This documentation is part of the Link Checker Library project.