2 * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
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
8 package org.opendaylight.controller.sal.restconf.impl.test;
10 import java.io.UnsupportedEncodingException;
12 import java.net.URLEncoder;
14 import com.google.common.base.Charsets;
16 public class RestOperationUtils {
18 static final String JSON = "+json";
19 static final String XML = "+xml";
21 private RestOperationUtils() {
24 static String createUri(String prefix, String encodedPart) throws UnsupportedEncodingException {
25 return URI.create(prefix + URLEncoder.encode(encodedPart, Charsets.US_ASCII.name()).toString()).toASCIIString();