idl.tmt.documentsource.webcrawl
Interface URLMapper

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
StringReplacementURLMapper, MultiMapURLMapper

public interface URLMapper
extends java.io.Serializable

Utility class for converting local URLs to remote URLs and vice versa. used for mapping between a locally mirrored file and its remote counterpart. Created on Jan 23, 2004

Author:
jelsas

Method Summary
 boolean containsLocalFile(java.io.File f)
          Indicates whether the mapping contains the local file
 boolean containsRemoteURL(java.net.URL u)
          Indicates whether the mapping contains the remote URL
 java.lang.String getDefaultIndexName()
          Returns the default name given to remote URLs which do not have a file name component.
 java.net.URL localFileToRemoteURL(java.io.File f)
          Creates a remote URL from a local URL.
 java.io.File remoteURLToLocalFile(java.net.URL u)
          Creates a local URL from a remote URL.
 void setDefaultIndexName(java.lang.String name)
          Sets the default index name to the specified string.
 

Method Detail

remoteURLToLocalFile

public java.io.File remoteURLToLocalFile(java.net.URL u)
Creates a local URL from a remote URL.
Parameters:
u - The remote URL.
Returns:
The local URL

localFileToRemoteURL

public java.net.URL localFileToRemoteURL(java.io.File f)
Creates a remote URL from a local URL.
Parameters:
u - The local URL.
Returns:
The remote URL

getDefaultIndexName

public java.lang.String getDefaultIndexName()
Returns the default name given to remote URLs which do not have a file name component. For example, the remote URL http://www.yahoo.com may be mirrored as the local URL file://home/data/www.yahoo.com/_INDEX.html . In this case, the defaultIndexName would be the string "_INDEX.html"
Returns:
the DefaultIndexName string

setDefaultIndexName

public void setDefaultIndexName(java.lang.String name)
Sets the default index name to the specified string.
Parameters:
name - String to use as the default index name.

containsLocalFile

public boolean containsLocalFile(java.io.File f)
Indicates whether the mapping contains the local file
Parameters:
f - the file
Returns:
true if the mapping contains this file

containsRemoteURL

public boolean containsRemoteURL(java.net.URL u)
Indicates whether the mapping contains the remote URL
Parameters:
u - the url
Returns:
true if the mapping contains this URL