From 697d02bf4e4188e3040cd987dee97d15f397a35f Mon Sep 17 00:00:00 2001 From: ramverma Date: Fri, 8 Jun 2018 11:56:21 +0100 Subject: Adding plugins-event module to apex-pdp Adding plugins-event module to apex-pdp Fix a minor bug in TextFileUtils Change-Id: I393c5f5809d078850d6669d22759ba9fa1b4f0e6 Issue-ID: POLICY-862 Signed-off-by: ramverma --- .../onap/policy/apex/model/utilities/TextFileUtils.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'model/utilities') diff --git a/model/utilities/src/main/java/org/onap/policy/apex/model/utilities/TextFileUtils.java b/model/utilities/src/main/java/org/onap/policy/apex/model/utilities/TextFileUtils.java index d119a3a35..97face9bd 100644 --- a/model/utilities/src/main/java/org/onap/policy/apex/model/utilities/TextFileUtils.java +++ b/model/utilities/src/main/java/org/onap/policy/apex/model/utilities/TextFileUtils.java @@ -5,15 +5,15 @@ * 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. - * + * * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ @@ -26,11 +26,10 @@ import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.nio.file.Files; -import java.nio.file.Paths; /** - * The Class TextFileUtils is class that provides useful functions for handling text files. - * Functions to read and wrtie text files to strings and strings are provided. + * The Class TextFileUtils is class that provides useful functions for handling text files. Functions to read and wrtie + * text files to strings and strings are provided. * * @author Liam Fallon (liam.fallon@ericsson.com) */ @@ -49,7 +48,8 @@ public abstract class TextFileUtils { * @throws IOException on errors reading text from the file */ public static String getTextFileAsString(final String textFilePath) throws IOException { - return new String(Files.readAllBytes(Paths.get(textFilePath))); + final File textFile = new File(textFilePath); + return new String(Files.readAllBytes(textFile.toPath())); } /** -- cgit 1.2.3-korg