Merge "Add support for multiple choice case statements within one augument in config...
[controller.git] / opendaylight / md-sal / sal-rest-connector / src / test / java / org / opendaylight / controller / sal / restconf / impl / test / RestOperationUtils.java
1 /*
2  * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.controller.sal.restconf.impl.test;
9
10 import java.io.UnsupportedEncodingException;
11 import java.net.URI;
12 import java.net.URLEncoder;
13
14 import com.google.common.base.Charsets;
15
16 public class RestOperationUtils {
17
18     public static final String JSON = "+json";
19     public static final String XML = "+xml";
20
21     private RestOperationUtils() {
22     }
23
24     public static String createUri(String prefix, String encodedPart) throws UnsupportedEncodingException {
25         return URI.create(prefix + URLEncoder.encode(encodedPart, Charsets.US_ASCII.name()).toString()).toASCIIString();
26     }
27 }