java.lang.Object
com.trapezium.util.RemoteUrlGenerator
- Direct Known Subclasses:
- UrlLocalizer
- public class RemoteUrlGenerator
- extends java.lang.Object
This class is used to generate remote urls that may be specified relative
to another url.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
remoteUrlPath
java.lang.String remoteUrlPath
remoteSite
java.lang.String remoteSite
NO_FILTERING
public static final int NO_FILTERING
- See Also:
- Constant Field Values
DIRECTORY_FILTERING
public static final int DIRECTORY_FILTERING
- See Also:
- Constant Field Values
SITE_FILTERING
public static final int SITE_FILTERING
- See Also:
- Constant Field Values
filterType
int filterType
extensionsToAccept
java.util.Vector extensionsToAccept
dbg
boolean dbg
- Get acceptable path, depending on filterType.
If we are doing SITE_FILTERING, any path with the same site is acceptable.
If we are doing DIRECTORY_FILTERING, any path with the same path as
passed to this object's constructor is acceptable.
If there are any specific extensions to avoid, these are filtered out.
If there are any specific extensions to accept, these are allowed.
RemoteUrlGenerator
public RemoteUrlGenerator(java.lang.String remoteUrlPath)
addExtensionAcceptor
public void addExtensionAcceptor(java.lang.String s)
getExtensionsToAccept
public java.util.Vector getExtensionsToAccept()
setExtensionsToAccept
public void setExtensionsToAccept(java.util.Vector v)
endInSlash
protected java.lang.String endInSlash(java.lang.String path)
- make sure a path ends in a slash
getRemoteUrlPath
public java.lang.String getRemoteUrlPath()
createUrlToFetch
public java.lang.String createUrlToFetch(java.lang.String remoteRelativeUrl)
- Create a remote url to fetch given a url that may be relative to
the remoteUrlPath (it may also be a completely specified url).
Filters out urls that are not part of the remoteUrlPath.
createSourceFileName
java.lang.String createSourceFileName(java.lang.String src)
- Creates a source file name
collapsePath
protected java.lang.String collapsePath(java.lang.String src)
- Get rid of ".." and "//" in paths, "//" OK only after http:
collapseSlash
protected java.lang.String collapseSlash(java.lang.String s)
setFilterType
public void setFilterType(int filterType)
- Set filtering to either DIRECTORY_FILTERING or SITE_FILTERING
makeFwdSlash
java.lang.String makeFwdSlash(java.lang.String s)
sourceStartsWithRemotePath
boolean sourceStartsWithRemotePath(java.lang.String src,
java.lang.String remotePath)
validatePath
java.lang.String validatePath(java.lang.String src)