Hi,
I need to access a network resource that requires authentication
(user/password): typically when I access through Windows Explore the network
shared folder:
\\<server>\<shared_folder>
I am required to supply username and password.
How to implement it in Java code and supply the information required?
Thank you,
Marco
Abhijat Vatsyayan - 05 Oct 2005 09:32 GMT
You might want to try executing (Runtime.exec ) a command like this -
"net use \\server\shared-folder password /USER:username " before
trying to access any files on this folder.
So if the server name is "myserver.mycomp.com" , shared folder name is
"net-share", user name is "marco" and password is "marco123", this
command will look like -
net use \\myserver.mycomp.com\net-share marco123 /USER:marco
Note that this will make "net-share" accessible on the computer to other
processes as well and any user working on the computer will be able to
get to this share without providing user id and password.
Are you sure that you need to access your files this way though? What
about using some other network protocols for accessing this network
resource ?
Abhijat
> Hi,
>
[quoted text clipped - 7 lines]
> Thank you,
> Marco
Marco Roda - 05 Oct 2005 12:53 GMT
Thank you,
That should work, but I think it is not the right way, as you said.
Currently I am trying using Perl NetResource module...
Marco
> You might want to try executing (Runtime.exec ) a command like this -
>
[quoted text clipped - 26 lines]
> > Thank you,
> > Marco
Rogan Dawes - 05 Oct 2005 13:08 GMT
> Hi,
>
[quoted text clipped - 7 lines]
> Thank you,
> Marco
This is a very vague request, but if I understand what you are asking
correctly, you may be able to achieve what you are after using jcifs.
Google for it.
Rogan
Manfred Rosenboom - 06 Oct 2005 08:52 GMT
Have a look at
http://www.norbert.hranitzky.com/jcifs/jcifs.htm
and then next to
http://jcifs.samba.org/
Roedy Green - 07 Oct 2005 12:13 GMT
>I need to access a network resource that requires authentication
see http://mindprod.com/jgloss/authentication.html

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.