Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2017
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. public void fileLoop() throws IOException
  2. {
  3. while(true)
  4. {
  5.  
  6. try
  7. {
  8. Thread.sleep(100);
  9. }
  10. catch (InterruptedException e1)
  11. {
  12. // TODO Auto-generated catch block
  13. e1.printStackTrace();
  14. }
  15. if(ThreadTest.words.isEmpty())
  16. {
  17. //System.out.print("emptu");
  18. }
  19.  
  20. else
  21. {
  22.  
  23. for(int i = 0; i<ThreadTest.words.size();i++)
  24. {
  25. try(BufferedReader br = new BufferedReader(new FileReader(ThreadTest.words.get(i))))
  26. {
  27. String line;
  28. while ((line = br.readLine()) != null)
  29. {
  30. ThreadTest.lines.add(line);
  31. }
  32. }
  33. catch (FileNotFoundException e)
  34. {
  35. e.printStackTrace();
  36. }
  37.  
  38. }
  39. }
  40. }
  41.  
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement