Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. "D:downloadmanagernodewebtorrent.cmd" download "magnet:?xt=urn:btih:08ada5a7a6183aae1e09d831df6748d566095a10&dn=Sintel" --select 0 --out "D://nf/"
  2.  
  3. @Override
  4. public synchronized void start() throws IOException {
  5. if (mWasDownloadStarted || mWasDownloadFinished) return;
  6.  
  7. mExec.getCommand().listIterator().forEachRemaining(s -> {
  8. System.out.print(s + " ");
  9. });
  10.  
  11. mExec.start();
  12. setProcessId();
  13.  
  14. mWasDownloadStarted = true;
  15. mWasDownloadStopped = false;
  16. }
  17.  
  18. private String buildCommand() {
  19. List <String> command = new ArrayList<>();
  20. command.add(""" + mManager.mWTLocation + """);
  21. command.add("download");
  22. command.add(""" + mManager.mMagnetUrl + """);
  23.  
  24. if (mManager.mFileIndex >= 0) {
  25. command.add("--select " + mManager.mFileIndex);
  26. }
  27.  
  28. if (mManager.mSaveTo != null) {
  29. command.add("--out "" + mManager.mSaveTo + """);
  30. }
  31.  
  32. mManager.mExec.command(command);
  33.  
  34. String cmdStr = "";
  35. for (String s : command) {
  36. cmdStr = cmdStr.concat(s + " ");
  37. }
  38.  
  39. return cmdStr.trim();
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement