Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Connecting a windows network share from Java with a specificied usernameand password

Reply
Thread Tools

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

 
 
eramitnema@gmail.com
Guest
Posts: n/a
 
      07-25-2007
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

 
Reply With Quote
 
 
 
 
Jani Tiainen
Guest
Posts: n/a
 
      07-25-2007
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.

--

Jani Tiainen
 
Reply With Quote
 
 
 
 
Lew
Guest
Posts: n/a
 
      07-25-2007
Repeating Jani's fine answer for the benefit of those in clj.help who wouldn't
have seen it due to the multipost.

Jani Tiainen wrote:
> 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.
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Share-Point-2010 ,Share-Point -2010 Training , Share-point-2010Hyderabad , Share-point-2010 Institute Saraswati lakki ASP .Net 0 01-06-2012 06:39 AM
connecting to a cifs or windows share on a nas device using a specificusername and password Carl ASP .Net 1 12-31-2007 02:17 AM
connecting to a cifs or windows share on a nas device using a specificusername and password Carl ASP .Net Building Controls 0 12-27-2007 08:33 PM
connecting to a cifs or windows share on a nas device using a specificusername and password Carl ASP .Net Security 0 12-27-2007 08:33 PM
Connecting a windows network share from Java with a specificied usernameand password Jay Hulslander Java 5 09-23-2005 08:21 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57