Advertisement
canezzy

zaBoduxa

Jan 12th, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.61 KB | None | 0 0
  1. BufferedReader brp = null;
  2. String currentLine;
  3.  
  4. try {
  5.     brp = new BufferedReader(new FileReader(filePath));
  6. } catch (FileNotFoundException e) {
  7.     System.out.println("Ne postoji fajl " + filePath);
  8.     e.printStackTrace();
  9. }
  10. try {
  11.     while ((currentLine = brp.readLine()) != null) {
  12.         //U currentLine ti se nalazi to sto si ucitao, ceo line iz fajla
  13.     }
  14. } catch (IOException e) {
  15.     System.out.println("Greska pri ucitavanju iz tekstualne datoteke " + filePath);
  16.     e.printStackTrace();
  17. }
  18. try {
  19.     brp.close();
  20. } catch (IOException e) {
  21.     System.out.println("Greska pri isključivanju čitača.");
  22.     e.printStackTrace();
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement