Fix sonar issues 11/26911/2
authorsiddharth0905 <siddharth.singh4@amdocs.com>
Tue, 26 Dec 2017 13:44:23 +0000 (19:14 +0530)
committerVitaly Emporopulo <Vitaliy.Emporopulo@amdocs.com>
Tue, 26 Dec 2017 15:41:57 +0000 (15:41 +0000)
Removed commented code, and refactor

Change-Id: I3cb107ab3931e323dd11c32c8285f871e5082531
Issue-ID: SDC-343
Signed-off-by: siddharth0905 <siddharth.singh4@amdocs.com>
openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/main/java/org/openecomp/core/utilities/file/FileUtils.java

index 5a8a2db..786def9 100644 (file)
@@ -43,8 +43,6 @@ import java.util.zip.ZipInputStream;
  */
 public class FileUtils {
 
-  //private final static Logger log = (Logger) LoggerFactory.getLogger(FileUtils.class.getName());
-
   /**
    * Allows to consume an input stream open against a resource with a given file name.
    *
@@ -56,7 +54,8 @@ public class FileUtils {
     Objects.requireNonNull(fileName);
 
     // the leading slash doesn't make sense and doesn't work when used with a class loader
-    URL resource = FileUtils.class.getClassLoader().getResource(fileName.startsWith("/") ? fileName.substring(1) : fileName);
+    URL resource = FileUtils.class.getClassLoader().getResource(fileName.startsWith("/")
+        ? fileName.substring(1) : fileName);
     if (resource == null) {
       throw new IllegalArgumentException("Resource not found: " + fileName);
     }
@@ -211,10 +210,10 @@ public class FileUtils {
       return FilenameUtils.getExtension(filename);
   }
 
-  public static String getNetworkPackageName(String filename){
+  public static String getNetworkPackageName(String filename) {
     String[] split = filename.split("\\.");
     String name = null;
-    if (split != null && split.length > 1){
+    if (split.length > 1) {
       name = split[0];
     }
     return name;