Connecting a windows network share from Java with a specificied usernameand password

E

eramitnema

Hello,

I have a problem related to networking. I have a problem accessing
network shared drives from within my java classes.

I used the File object when I was developing. Everything worked fine.
However, I have to deploy to an application server, I need to supply a
user name and password to connect.

I am looking for an easy way to connect to a windows network share
with a user name and password from Java. I started to looking at JNI,
but I was hoping there might be an easier to use wrapper already
written.

I have a shared folder address as \\machine name\folder1, username and
password.

I assume this has something to do with Windows network security?

Can anybody help me?
Any help would be greatly appreciated.

Thanks in advance,
Amit
 
J

Jani Tiainen

(e-mail address removed) kirjoitti:
Hello,

I have a problem related to networking. I have a problem accessing
network shared drives from within my java classes.

Sure you do since those are not really "drives".
I used the File object when I was developing. Everything worked fine.
However, I have to deploy to an application server, I need to supply a
user name and password to connect.

I am looking for an easy way to connect to a windows network share
with a user name and password from Java. I started to looking at JNI,
but I was hoping there might be an easier to use wrapper already
written.

There is nice JCIFS (http://jcifs.samba.org/) package that has SMB
protocol implementation and allows you to work with SMB shares (that
includes Windows shares too).
I have a shared folder address as \\machine name\folder1, username and
password.

I assume this has something to do with Windows network security?

Not really. It's just part of SMB protocol.
 
L

Lew

Repeating Jani's fine answer for the benefit of those in clj.help who wouldn't
have seen it due to the multipost.
 

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

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,240
Members
46,830
Latest member
HeleneMull

Latest Threads

Top