/**
 * Yobi, Project Hosting SW
 *
 * Copyright 2013 NAVER Corp.
 * http://yobi.io
 *
 * @Author Wansoon Park, Keesun Baek
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package actions.support;

import org.apache.commons.lang3.StringUtils;


public class PathParser {
    private static final char DELIMETER = '/';
    private String[] paths;
    private String contextPath;
    private String path;

    public PathParser(String path) {
        this.paths = StringUtils.split(path, DELIMETER);
    }

    public PathParser(String contextPath, String path) {
        this.contextPath = contextPath;
        this.path = path;
        makePath();
    }

    private void makePath() {
        if(StringUtils.endsWith(this.contextPath, "/")) {
            int start = 0;
            int end = this.contextPath.length() - 1;
            this.contextPath = StringUtils.substring(this.contextPath, start, end);
        }
        this.path = StringUtils.remove(this.path, this.contextPath);
        this.paths = StringUtils.split(this.path, DELIMETER);
    }

    public String getOwnerLoginId() {
        return this.paths[0];
    }

    public String getProjectName() {
        return this.paths[1];
    }

    public int getPullRequestNumber() {
        return Integer.parseInt(this.paths[3]);
    }
    public String toString() {
        return DELIMETER + StringUtils.join(this.paths, DELIMETER);
    }
}

@@ -804,12 +804,14 @@
 nal 
-char
+String
  DEL
@@ -823,11 +823,11 @@
 R = 
-'/'
+%22/%22
 ;%0A  
@@ -1099,335 +1099,54 @@
 h = 
-contextPath;%0A        this.path = path;%0A        makePath();%0A    %7D%0A%0A    private void makePath() %7B%0A        if(StringUtils.endsWith(this.contextPath, %22/%22)) %7B%0A            int start = 0;%0A            int end = this.contextPath.length() - 1;%0A            this.contextPath = StringUtils.substring(this.contextPath, start, end);%0A        %7D
+StringUtils.removeEnd(contextPath, DELIMETER);
 %0A   
@@ -1180,22 +1180,22 @@
 s.remove
-(this.
+Start(
 path, th

modify PathParser using removeEnd / removeStart method