Guest User

Untitled

a guest
May 21st, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. try{
  2.  
  3. StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
  4.  
  5. StrictMode.setThreadPolicy(policy);
  6.  
  7.  
  8. String user = "username";
  9. String pass ="password";
  10.  
  11.  
  12. //Archivo a Copiar
  13. String urlconvert = "smb://IP/Compartido/test12.txt";
  14. NtlmPasswordAuthentication auth = new NtlmPasswordAuthentication(
  15. "DOMINIO.COM", user, pass);
  16.  
  17. SmbFile sFile = new SmbFile(urlconvert, auth);
  18.  
  19. //Destino
  20. String sharedFolder2="Test";
  21. String url = "smb://IP/" + sharedFolder2 + "/";
  22.  
  23. SmbFile sDes = new SmbFile(url,auth);
  24. sFile.copyTo(sDes);
  25. }
Add Comment
Please, Sign In to add comment