Class URLFixer

java.lang.Object
  |
  +--URLFixer

public class URLFixer
extends java.lang.Object

Helper class that is used to resolve relative url's, given a parent context url


Constructor Summary
URLFixer()
           
 
Method Summary
static java.net.URL fix(java.net.URL parent, java.lang.String linkCandidate)
          Function takes the parent level URL and the linkCandidate and attempts to resolve any relative linkage.
private static java.lang.String[] getDirectoryAndFile(java.lang.String urlString)
          Function takes the non-host part of the string and returns the directory structure only.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

URLFixer

public URLFixer()
Method Detail

getDirectoryAndFile

private static java.lang.String[] getDirectoryAndFile(java.lang.String urlString)
Function takes the non-host part of the string and returns the directory structure only. the directory will get returned with a '/' at the end and at the beginning! the file will be returned as the plain file

Returns:
returns an array representing the pair: directory and file

fix

public static java.net.URL fix(java.net.URL parent,
                               java.lang.String linkCandidate)
                        throws java.net.MalformedURLException
Function takes the parent level URL and the linkCandidate and attempts to resolve any relative linkage.

Returns:
URL - the valid url of the fixed link
java.net.MalformedURLException