Merge "BUG-2329 Add test for anyxmls inside rpc resonse for netcfon-connector"
[controller.git] / opendaylight / sal / api / src / main / java / org / opendaylight / controller / sal / utils / ReadFromFile.java
index 1d31eaa65b44e605d42b09711b6ef4f93bc4f5ff..343962bb24aabf3d58025c842b719bf4f102d4fb 100644 (file)
@@ -9,8 +9,14 @@
 
 package org.opendaylight.controller.sal.utils;
 
+import java.io.BufferedReader;
+import java.io.DataInputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStreamReader;
 import java.util.ArrayList;
-import java.io.*;
 
 /**
  * Convenience object for reading from file
@@ -20,20 +26,16 @@ import java.io.*;
  */
 public class ReadFromFile {
     private FileInputStream fileStream;
-    private DataInputStream dataInput;
-    private BufferedReader bufferedReader;
-    private String fileName;
     private File filePointer;
 
-    public ReadFromFile(String name) throws FileNotFoundException {
-        fileName = name;
-        fileStream = new FileInputStream(this.fileName);
+    public ReadFromFile(String fileName) throws FileNotFoundException {
+        fileStream = new FileInputStream(fileName);
         filePointer = new File(fileName); //needed to allow file deletion
     }
 
     public ArrayList<String> readFile() throws IOException {
-        dataInput = new DataInputStream(this.fileStream);
-        bufferedReader = new BufferedReader(new InputStreamReader(dataInput));
+        DataInputStream dataInput = new DataInputStream(this.fileStream);
+        BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(dataInput));
 
         ArrayList<String> lineList = new ArrayList<String>();
         String line;