daily pastebin goal
0%
SHARE
TWEET

lapchuju

a guest Dec 14th, 2018 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.io.*;
  2. import java.util.ArrayList;
  3.  
  4. public class EmployeeList {
  5.  
  6.     private ArrayList<Emplyee> emplyees;
  7.     public EmployeeList(){
  8.         emplyees = new ArrayList<Emplyee>();
  9.     }
  10.     public void add(Emplyee sb){
  11.         emplyees.add(sb);
  12.     }
  13.     public void readFromCSV(String filepath) throws IOException {
  14.         File file = new File(filepath);
  15. //        ClassLoader classLoader = getClass().getClassLoader();
  16. //        File file = new File(classLoader.getResource(filepath).getFile());
  17.         FileReader reader = null;
  18.         try {
  19.             reader = new FileReader(file);
  20.         } catch (FileNotFoundException e) {
  21.             e.printStackTrace();
  22.             System.exit(1);
  23.         }
  24.         BufferedReader Br = new BufferedReader(reader);
  25.         String line = "";
  26.        
  27.         while (Br.ready()){
  28.             line += Br.readLine();
  29.             line += "\n";
  30.         }
  31.         Br.close();
  32.     }
  33. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top