Results 1 to 2 of 2
  1. #1
    kaswan_savita is offline Member
    Join Date
    Feb 2011
    Rep Power

    Default Access share folder with user authentication

    Can we access share folder with username and password uaing java.
    plz provide some example

  2. #2
    qualitystreet is offline Member
    Join Date
    Apr 2011
    Rep Power


    You will need to add jcifs to the project.

    String user = "administrator:password";
    NtlmPasswordAuthentication auth = new NtlmPasswordAuthentication(user);
    String path = "smb://$/test.txt";
    SmbFile sFile = new SmbFile(path, auth);
    SmbFileOutputStream sfos = new SmbFileOutputStream(sFile);
    sfos.write("Some Text".getBytes());

Similar Threads

  1. how to access a file in the present folder.
    By AnanthNag.Kundanala in forum New To Java
    Replies: 2
    Last Post: 01-11-2011, 04:40 PM
  2. Single user Login authentication
    By vinoopraj in forum Web Frameworks
    Replies: 0
    Last Post: 07-20-2010, 08:19 AM
  3. Replies: 2
    Last Post: 05-18-2010, 03:12 PM
  4. preventing access/locking a folder?
    By solris in forum New To Java
    Replies: 1
    Last Post: 06-29-2009, 12:20 AM
  5. how to access shared file/folder in LAN
    By ksheetiz in forum Networking
    Replies: 1
    Last Post: 05-24-2008, 04:54 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts