| | |
| | | } |
| | | |
| | | |
| | | target = uri.substring(contextLength, last); |
| | | target = uri.subString(contextLength, last); |
| | | |
| | | // 2. root |
| | | if ("/".equals(target)) { |
| | |
| | | // 3. find root |
| | | int pos = target.lastIndexOf("/root/"); |
| | | if (pos >= 0) { |
| | | target = target.substring(pos + "/root/".length()); |
| | | target = target.subString(pos + "/root/".length()); |
| | | } |
| | | |
| | | if (target.charAt(0) != '/') { |
| | |
| | | int pos_dot = target.lastIndexOf("."); |
| | | |
| | | if (pos_dot > 0) { |
| | | suffix = target.substring(pos_dot); |
| | | suffix = target.subString(pos_dot); |
| | | type = RequestType.Resource; |
| | | } else { |
| | | type = RequestType.VirtualPath; |
| | |
| | | |
| | | int pos_begin = target.indexOf("/", 1); |
| | | if (pos_begin > 0) { |
| | | parent = target.substring(0, pos_begin); |
| | | parent = target.subString(0, pos_begin); |
| | | } |
| | | |
| | | int pos_end = target.lastIndexOf("/"); |
| | | if (pos_end >= pos_begin) { |
| | | leaf = target.substring(pos_end); |
| | | leaf = target.subString(pos_end); |
| | | } |
| | | |
| | | shortTarget = target.substring(1); |
| | | shortTarget = target.subString(1); |
| | | } |
| | | |
| | | public String getSuffix() { |