diff options
author | avigaffa <avi.gaffa@amdocs.com> | 2017-12-31 15:07:39 +0200 |
---|---|---|
committer | vempo <vitaliy.emporopulo@amdocs.com> | 2018-01-02 09:41:41 +0200 |
commit | da5dfcd1a354807d13849c7f4ead535ccfa722fa (patch) | |
tree | b4ef0b97d4c25a38bf4a7a8aa5d3626d6b820a17 /openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/main/java/org/openecomp/core/utilities/file | |
parent | 25ca73d85757869a6d9cc33861070778503ff153 (diff) |
Fixing sonar Exception Handling
Change-Id: I04eb047973a3f5c07dd9dc410cb13af974e8ded1
Issue-ID: SDC-810
Signed-off-by: avigaffa <avi.gaffa@amdocs.com>
Signed-off-by: vempo <vitaliy.emporopulo@amdocs.com>
Diffstat (limited to 'openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/main/java/org/openecomp/core/utilities/file')
-rw-r--r-- | openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/main/java/org/openecomp/core/utilities/file/FileUtils.java | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/main/java/org/openecomp/core/utilities/file/FileUtils.java b/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/main/java/org/openecomp/core/utilities/file/FileUtils.java index 786def961a..e70ad923a2 100644 --- a/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/main/java/org/openecomp/core/utilities/file/FileUtils.java +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/main/java/org/openecomp/core/utilities/file/FileUtils.java @@ -1,21 +1,17 @@ -/*- - * ============LICENSE_START======================================================= - * SDC - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ +/* + * Copyright © 2016-2017 European Support Limited + * * 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. - * ============LICENSE_END========================================================= */ package org.openecomp.core.utilities.file; @@ -189,7 +185,7 @@ public class FileUtils { return IOUtils.toByteArray(input); } catch (IOException exception) { throw new RuntimeException( - "error will convertion input stream to byte array:" + exception.getMessage()); + "error while converting input stream to byte array", exception); } } @@ -203,7 +199,7 @@ public class FileUtils { if (!fileName.contains(".")) { return fileName; } - return fileName.substring(0, fileName.lastIndexOf(".")); + return fileName.substring(0, fileName.lastIndexOf('.')); } public static String getFileExtension(String filename) { @@ -264,7 +260,7 @@ public class FileUtils { */ YML("yml"); - private String displayName; + private final String displayName; FileExtension(String displayName) { this.displayName = displayName; |