Set the path element using a String. Elements of the path array are parsed out @param rawPath the raw path, e.g., /foo/:path1/bat
(String rawPath)
| 171 | * @param rawPath the raw path, e.g., /foo/:path1/bat |
| 172 | */ |
| 173 | public void setPath(String rawPath) { |
| 174 | |
| 175 | ArrayList<String> pathElements; |
| 176 | ArrayList<String> liPath; |
| 177 | this.path = new ArrayList<String>(); |
| 178 | if (rawPath != null && rawPath.length() > 0) { |
| 179 | pathElements = new ArrayList<String>(Arrays.asList(rawPath.split("/"))); |
| 180 | liPath = new ArrayList<String>(Arrays.asList(new String[0])); |
| 181 | for (int i = 0; i < pathElements.size(); i++) { |
| 182 | if (pathElements.get(i) != null && pathElements.get(i).length() > 0) { |
| 183 | liPath.add(pathElements.get(i)); |
| 184 | if (pathElements.get(i).substring(0, 1).equals(":")) { |
| 185 | this.addPathVariable(pathElements.get(i).substring(1), null, null); |
| 186 | } |
| 187 | } |
| 188 | } |
| 189 | |
| 190 | this.path = liPath; |
| 191 | } |
| 192 | |
| 193 | } |
| 194 | |
| 195 | |
| 196 | /** |