net.sourceforge.sillyview
Class URLParser

java.lang.Object
  extended by net.sourceforge.sillyview.URLParser

public class URLParser
extends Object

Provides some static methods for dealing with URLs passed from a View.


Constructor Summary
URLParser()
           
 
Method Summary
static String getFilenameWithoutPath(String x)
          Given, for example, the string "http://foo.bar.com/some/dir/lala.jpg?foo=bar" will return "lala.jpg".
static String getFilenameWithoutPath(URL u)
          Strips the last element of the URL's path and returns it.
static Hashtable<String,String> parseVariables(String x)
          Parses a set of name/value pairs in the form of "name=value&foo=bar" into a Hashtable and returns it.
static Hashtable parseVariables(URL u)
          Takes the name/value pairs of the URL's query and returns them as a Hashtable.
static void setPostToken(String s)
           
static void setPreToken(String s)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

URLParser

public URLParser()
Method Detail

setPreToken

public static void setPreToken(String s)

setPostToken

public static void setPostToken(String s)

parseVariables

public static Hashtable parseVariables(URL u)
Takes the name/value pairs of the URL's query and returns them as a Hashtable.

Parameters:
u - an URL value
Returns:
a Hashtable value

parseVariables

public static Hashtable<String,String> parseVariables(String x)
Parses a set of name/value pairs in the form of "name=value&foo=bar" into a Hashtable and returns it.

Parameters:
u - an String value
Returns:
a Hashtable value

getFilenameWithoutPath

public static String getFilenameWithoutPath(URL u)
Strips the last element of the URL's path and returns it. Given, for example, the URL: "http://foo.bar.com/some/dir/lala.jpg?foo=bar" will return "lala.jpg".

Parameters:
u - an URL value
Returns:
a String value

getFilenameWithoutPath

public static String getFilenameWithoutPath(String x)
Given, for example, the string "http://foo.bar.com/some/dir/lala.jpg?foo=bar" will return "lala.jpg".

Parameters:
x - a String value
Returns:
a String value