By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,806 Members | 1,363 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,806 IT Pros & Developers. It's quick & easy.

Copy files from samba share

100+
P: 184
Hi All,

I would like to have the simple java code that copy the files from samba share to local drive.

When i tried with below snippet , file not found exception occured. Please do needful
Expand|Select|Wrap|Line Numbers
  1. try{
  2.  
  3. String source = "//IP.VV.YY.XXX//test//mm";
  4. File sourceFile = new File(source);
  5. FileInputStream stream = new FileInputStream(sourceFile);
  6. System.out.println("\n\n Input stream available >>>>>>>>>> "+stream.available()+"\n\n\n");
  7.  
  8. }catch(Exception e){
  9. e.printStackTrace();
  10. }
  11.  
  12.  
  13. Exception:
  14. java.io.FileNotFoundException: \\IP.VV.YY.XXX\test\mm(The system detected a possible attempt to compromise security. Please ensure that you can contact the server that authenticated you.)
  15.  
  16.  
Sep 4 '12 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.