}
public URLConnection openConnection(URL url) throws IOException
{
// Create properties object
CaseInsensitiveMap properties = new CaseInsensitiveMap();
if (url.getQuery() != null)
{
String propString = url.getQuery();
StringTokenizer tok = new StringTokenizer(propString);
boolean firstProperty = true;
// We now parse the property pairs query string.
// This has the format name=value&name=value...(etc)
while (tok.hasMoreElements())
{
String name = tok.nextToken("=");
// "name" will now contain the name of the property we are trying to
// set. Property pairs are seperated by the '&' symbol. The tokenizer
// will include this symbol in the token so we need to return it from
// all property names except the first.
if (!!!firstProperty)
name = name.substring(1);
String value = tok.nextToken("&").substring(1);
properties.put(name, value);
firstProperty = false;
}
}
return new WARConnection(new URL(url.getPath()), properties);