2 * Copyright (c) 2016 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
9 package org.opendaylight.groupbasedpolicy.sxp_ise_adapter.impl;
11 import java.io.BufferedReader;
12 import java.io.IOException;
13 import java.io.InputStream;
14 import java.io.InputStreamReader;
17 * Purpose: read content of given test file
19 public class IseResourceTestHelper {
20 public static String readLocalResource(final String resourcePath) throws IOException {
21 final StringBuilder collector = new StringBuilder();
23 final InputStream iseReplySource = IseResourceTestHelper.class.getResourceAsStream(resourcePath);
24 final BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(iseReplySource))
27 while ((line = bufferedReader.readLine()) != null) {
28 collector.append(line);
31 return collector.toString();