Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

connecting to shared folder in windows  RSS feed

 
S Shehab
Ranch Hand
Posts: 491
Android Eclipse IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys ,

I need to connect to a shared folder on a remote windows machine through java , where i put my domain authentication (username and password ) in the code , here is my code


Please advice ...
 
Rob Spoor
Sheriff
Posts: 20893
81
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out JCIFS. Your code would work if you didn't need to connect with a different user name / password than those you logged into Windows with.
 
S Shehab
Ranch Hand
Posts: 491
Android Eclipse IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rob Prime wrote:Check out JCIFS. Your code would work if you didn't need to connect with a different user name / password than those you logged into Windows with.


Thanks for your reply , Ya you are right , but actually i need to connect using username and password , do you think JCIFS will help, no other way without using JCIFS? ,any tutorials for it ?
 
Rob Spoor
Sheriff
Posts: 20893
81
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Main page
Javadoc (you will want jcifs.smb.SmbFile)

After that it should be pretty easy; use SmbFile where you normally use java.io.File. The rest is more or less the same, only SmbFile has its own methods for getting an input or output stream to it, instead of separate classes FileInputStream and FileOutputStream.
 
S Shehab
Ranch Hand
Posts: 491
Android Eclipse IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI ,

I used the JCIFS but when ii'm trying to connect i got this exception :

although i;m sure from the username and password !!

Here is my code :


Anything i'm missing ?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!