aspose file tools*
The moose likes Java in General and the fly likes connecting to shared folder in windows Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "connecting to shared folder in windows" Watch "connecting to shared folder in windows" New topic
Author

connecting to shared folder in windows

Sherif Shehab
Ranch Hand

Joined: Mar 05, 2007
Posts: 483

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 ...


Thanks,
Sherif
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19692
    
  20

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.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Sherif Shehab
Ranch Hand

Joined: Mar 05, 2007
Posts: 483

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

Joined: Oct 27, 2005
Posts: 19692
    
  20

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.
Sherif Shehab
Ranch Hand

Joined: Mar 05, 2007
Posts: 483

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 ?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: connecting to shared folder in windows