// Path: commons/src/main/java/org/nesty/commons/constant/http/RequestMethod.java
// public enum RequestMethod {
//     GET, POST, PUT, DELETE, UNKOWN
// }
// 
// Path: core/src/main/java/org/nesty/core/server/utils/HttpUtils.java
// public class HttpUtils {
// 
//     public static RequestMethod convertHttpMethodFromNetty(FullHttpRequest request) {
//         try {
//             return RequestMethod.valueOf(request.getMethod().name().toUpperCase());
//         } catch (IllegalArgumentException | NullPointerException e) {
//             return RequestMethod.UNKOWN;
//         }
//     }
// 
//     public static String truncateUrl(String url) {
//         if (url.contains("?"))
//             url = url.substring(0, url.indexOf("?"));
//         return url;
//     }
// }


import com.google.common.base.Joiner;
import com.google.common.base.Splitter;
import org.nesty.commons.constant.http.RequestMethod;
import org.nesty.core.server.utils.HttpUtils;
import java.util.ArrayList;
import java.util.List;
package org.nesty.core.server.rest;



/**
 * Represent one URI resource. include http uri and http method
 *
 * Author Michael on 03/03/2016.
 */
public class URLResource {

    // variable flag
    public static final char VARIABLE = '{';
    // resource identifier
    private URLResourceIdentifier identifier;

    private URLResource() {

    }

// Path: commons/src/main/java/org/nesty/commons/constant/http/RequestMethod.java
// public enum RequestMethod {
//     GET, POST, PUT, DELETE, UNKOWN
// }
// 
// Path: core/src/main/java/org/nesty/core/server/utils/HttpUtils.java
// public class HttpUtils {
// 
//     public static RequestMethod convertHttpMethodFromNetty(FullHttpRequest request) {
//         try {
//             return RequestMethod.valueOf(request.getMethod().name().toUpperCase());
//         } catch (IllegalArgumentException | NullPointerException e) {
//             return RequestMethod.UNKOWN;
//         }
//     }
// 
//     public static String truncateUrl(String url) {
//         if (url.contains("?"))
//             url = url.substring(0, url.indexOf("?"));
//         return url;
//     }
// }


// Path: core/src/main/java/org/nesty/core/server/rest/URLResource.java
import com.google.common.base.Joiner;
import com.google.common.base.Splitter;
import org.nesty.commons.constant.http.RequestMethod;
import org.nesty.core.server.utils.HttpUtils;
import java.util.ArrayList;
import java.util.List;

package org.nesty.core.server.rest;



/**
 * Represent one URI resource. include http uri and http method
 *
 * Author Michael on 03/03/2016.
 */
public class URLResource {

    // variable flag
    public static final char VARIABLE = '{';
    // resource identifier
    private URLResourceIdentifier identifier;

    private URLResource() {

    }

    public static URLResource fromHttp(String url, RequestMethod requestMethod) {