Java connecting to a file share

C

ccjjharmon

Good morning everyone.

I have a need to read File objects from a network share on a Windows
file server. Currently I connect using a properly written URI to
retrieve the File object, and it works. I will be instantiating a bean
(from a servlet) that does this communication, and the servlet will
dispatch a JSP. In the end, this web app will be running within Tomcat
5.0.

OK so where's the question? My current state does not allow for
configuring the authentication to the file server. Whatever Tomcat is
running as determines how it authenticates with the file server.

What I would like to do is be able to pass a username and password
(encrypted of course).

I know there are several tools (JAAS, JNDI) that in some way can be
used for this, but I haven't read much about it... and certainly
anything that clearly says this one works, this one doesn't...

Can anyone provide some guidance?

Thanks!
 
C

Chris Uppal

I have a need to read File objects from a network share on a Windows
file server.[...]

OK so where's the question? My current state does not allow for
configuring the authentication to the file server. Whatever Tomcat is
running as determines how it authenticates with the file server.

jCIFS might help.

http://jcifs.samba.org/

E.g. read:

http://jcifs.samba.org/src/docs/faq.html#auth

SMB/CIFFS authentication appears to be something of a muddle, so be careful
that you understand what the authentication methods are (I don't ;-) and that
the method you are using satisfies your security requirements.

I know there are several tools (JAAS, JNDI) that in some way can be
used for this,

I don't think either of those are about authenticating your connection to an
existing (non-Java) application such as a Windows file server.

-- chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,771
Messages
2,569,587
Members
45,099
Latest member
AmbrosePri
Top