Advertisement
Guest User

Mue

a guest
Mar 23rd, 2019
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. import java.io.InputStream;
  2. import java.io.FileInputStream;
  3.  
  4. public class Wget
  5. {
  6.  
  7. public static void main(String[] args)
  8. {
  9. int contador = 0;
  10.  
  11. if(args[0].contains("-f"))
  12. {
  13. try
  14. {
  15. InputStream objReader = new FileInputStream (args[1]);
  16. int lectura;
  17. String direcciones = "";
  18.  
  19. while ((lectura = objReader.read()) != -1)
  20. {
  21. direcciones += (char)lectura;
  22. if(lectura == 13)
  23. contador ++;
  24. }
  25.  
  26. String Dir[] = direcciones.split("\n");
  27.  
  28. for (int i = 0; i < Dir.length; i++)
  29. {
  30. Fil f = new Fil(Dir[i], contador, args);
  31. f.start();
  32. }
  33. }
  34. catch(Exception e)
  35. {
  36. System.out.println (e);
  37. }
  38. }
  39. }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement