* @return a map of all the source/target URLs needed to copy
* the file along with all its relative referents.
*/
public static Map findAllRelative(URL source, URL target)
{
Map result = new SequencedHashMap();
result.put(source, target);
LinkedList process = new LinkedList();
process.add(source);
while (!process.isEmpty())
{
URL nextSource = (URL)process.removeFirst();
URL nextTarget = (URL)result.get(nextSource);
Map nextResults = findRelativeInOne(nextSource, nextTarget);
for (Iterator i = nextResults.keySet().iterator(); i.hasNext(); )
{
URL newSource = (URL)i.next();
if (result.containsKey(newSource))
continue;
result.put(newSource, nextResults.get(newSource));
process.add(newSource);
}
}
return result;