Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void copyFromNetwork(String NetworkFile, String DestinationFile) {
- NtlmPasswordAuthentication auth = new NtlmPasswordAuthentication("Domain",
- "User", "Password");
- SmbFile remoteFile;
- try {
- OutputStream os = new FileOutputStream(DestinationFile);
- InputStream is = null;
- is = remoteFile.getInputStream();
- int bufferSize = 5096;
- byte[] b = new byte[bufferSize];
- int noOfBytes = 0;
- while ((noOfBytes = is.read(b)) != -1) {
- os.write(b, 0, noOfBytes);
- }
- os.close();
- is.close();
- } catch (Exception ex) {
- Log.w("FileCopy", ex);
- }
- }
- SmbFile remoteFile;//<-- HERE
- try {
- OutputStream os = new FileOutputStream(DestinationFile);
- InputStream is = null;
- is = remoteFile.getInputStream();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement