This documentation is part of the Link Checker Library project.

de.tw.website.linkchecker
Interface WebSiteInfo

All Known Implementing Classes:
DefaultWebSiteInfo

public interface WebSiteInfo

Information about a Web-Site. This might be very specific Information; a default implementation DefaultWebSiteInfo implements a simple version of this interface.

Version:
1.0
Author:
Thomas Weinbrenner

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.
 

Method Detail

isUrlOfTypeHTML

public boolean isUrlOfTypeHTML(java.lang.String url)
Information about a specific URL.
Returns:
True, if the url is of type HTML.

getFileSystems

public java.util.List getFileSystems()
Returns a list of the topmost directories (as string) which are the file systems where the HTML-files are located.
Returns:
list of file systems as strings.

getURLFromFileName

public java.lang.String getURLFromFileName(java.lang.String fileName)
Maps a file name to a URL.
Returns:
The URL which maps to the given file name or null, if the mapping could not be made.

getFileNameFromURL

public java.lang.String getFileNameFromURL(java.lang.String url)
Maps a URL to a file name.
Returns:
The name of the file which maps to the URL or null, if the mapping could not be made.

getURLFromJavaScriptCode

public java.lang.String getURLFromJavaScriptCode(java.lang.String targetUrl)
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.
Returns:
URL, if there is a URL in the javascript code, otherwise null.

shortenUrlForDisplay

public 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.

shortenFileNameForDisplay

public 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.

getUrlInputStream

public java.io.InputStream getUrlInputStream(java.lang.String url)
                                      throws java.lang.Exception
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.

This documentation is part of the Link Checker Library project.