# HG changeset patch # User xitiomet # Date 1322338029 18000 # Node ID 85b35dfc0935ea5e36d0f39351eff3f41c8931b9 # Parent 138f56cde331bc5adeea2f6fea2da2fb5ce48c0b path array diff -r 138f56cde331bc5adeea2f6fea2da2fb5ce48c0b -r 85b35dfc0935ea5e36d0f39351eff3f41c8931b9 src/org/openstatic/http/HttpRequest.java --- a/src/org/openstatic/http/HttpRequest.java Sat Nov 26 02:56:01 2011 -0500 +++ b/src/org/openstatic/http/HttpRequest.java Sat Nov 26 15:07:09 2011 -0500 @@ -24,6 +24,8 @@ import java.util.Date; import java.util.Enumeration; import java.util.Hashtable; +import java.util.StringTokenizer; +import java.util.Vector; import org.json.*; @@ -112,6 +114,17 @@ { return this.path; } + + public String[] getFullPathArray() + { + Vector rv = new Vector(); + for (StringTokenizer st = new StringTokenizer(this.getFullPath(), "/"); st.hasMoreTokens(); ) + { + String next_item = st.nextToken(); + rv.add(next_item); + } + return rv.toArray(new String[rv.size()]); + } /** Get the localized path of this request */ public String getPath() @@ -122,6 +135,17 @@ return_path = this.path.substring(this.request_prefix.length()-1); return return_path; } + + public String[] getPathArray() + { + Vector rv = new Vector(); + for (StringTokenizer st = new StringTokenizer(this.getPath(), "/"); st.hasMoreTokens(); ) + { + String next_item = st.nextToken(); + rv.add(next_item); + } + return rv.toArray(new String[rv.size()]); + } /** Return the entire path with parameters */ public String getPathWithParams()