- /** The repository name is the first part of the path info */
- protected String extractRepositoryName(List<String> pathTokens) {
- StringBuffer currName = new StringBuffer("");
- for (String token : pathTokens) {
- currName.append(token);
- if (repositoryRegister.getRepositories().containsKey(
- currName.toString()))
- return currName.toString();
- currName.append('/');
+ /** Returns the first two token of the path */
+ // protected String[] extractPrefix(String pathInfo) {
+ // String[] res = new String[2];
+ // StringTokenizer st = new StringTokenizer(pathInfo, "/");
+ // if (st.hasMoreTokens())
+ // res[0] = st.nextToken();
+ // if (st.hasMoreTokens())
+ // res[1] = st.nextToken();
+ // return res;
+ // }
+
+ /** Returns the first token of the path */
+ protected String extractRepositoryAlias(String pathInfo) {
+ StringBuffer buf = new StringBuffer();
+ for (int i = 1; i < pathInfo.length(); i++) {
+ char c = pathInfo.charAt(i);
+ if (c == '/')
+ break;
+ buf.append(c);