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

Discussion in 'Java' started by eramitnema@gmail.com, Jul 25, 2007.

  1. Guest

    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
     
    , Jul 25, 2007
    #1
    1. Advertising

  2. Jani Tiainen Guest

    Re: Connecting a windows network share from Java with a specificiedusernameand password

    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
     
    Jani Tiainen, Jul 25, 2007
    #2
    1. Advertising

  3. Lew Guest

    Re: Connecting a windows network share from Java with a specificiedusernameand password

    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.
    >
     
    Lew, Jul 25, 2007
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jay Hulslander
    Replies:
    5
    Views:
    14,755
    Raymond DeCampo
    Sep 23, 2005
  2. Carl
    Replies:
    1
    Views:
    510
    Alvin Bruney [MVP]
    Dec 31, 2007
  3. Carl
    Replies:
    0
    Views:
    676
  4. Carl
    Replies:
    0
    Views:
    166
  5. Saraswati lakki
    Replies:
    0
    Views:
    1,424
    Saraswati lakki
    Jan 6, 2012
Loading...

Share This Page