Results 1 to 4 of 4
  1. #1
    luislopezco is offline Member
    Join Date
    May 2008
    Posts
    3
    Rep Power
    0

    Default [SOLVED] Connection to file server

    Hello I have a problem with a Java application that I developed, the application must read and write files on a file server, now I'm doing this to read files

    byte [] BytesRead = new byte [size];
    InputStream stream = new FileInputStream (route + fileName);
    stream.read (BytesRead);
    stream.close ();


    But I get the following error:

    java.io.FileNotFoundException: \\server\folder\5\MI143895001.tif (The system detected a possible attempt to compromise security. Please ensure that you can contact the server that you authenticated.)

    I understand that the mistake is because I am trying to connect to a server that is not public (server is a windows NAS), has user name and password. The way to connect to the server is as follows

    @echo off
    net use \\server\folder /user: DOM\user password
    Exit


    How can i connect to the server from my java application? There is any java class that do this?

    Thank you very much

  2. #2
    danielstoner's Avatar
    danielstoner is offline Senior Member
    Join Date
    Apr 2008
    Location
    Canada
    Posts
    191
    Rep Power
    7

    Default

    You need to get authenticated. Since you are on Windows you need to find a Java library that knows to do this for you. Read more about JAAS and MS Active Directory. Check out this project: JaasLounge Project
    Daniel @ [www.littletutorials.com]
    Language is froth on the surface of thought

  3. #3
    luislopezco is offline Member
    Join Date
    May 2008
    Posts
    3
    Rep Power
    0

    Default

    Thanks danielstoner,
    i got connect to the server with Jaas NtlmLoginModule (JaasLounge project).

  4. #4
    danielstoner's Avatar
    danielstoner is offline Senior Member
    Join Date
    Apr 2008
    Location
    Canada
    Posts
    191
    Rep Power
    7

    Default

    If this is a solved problem please mark the thread as SOLVED. I also don't get upset if you add to my reputation by pressing the REP button on my answer. LOL
    Daniel @ [www.littletutorials.com]
    Language is froth on the surface of thought

Similar Threads

  1. To transfer a file from client to server
    By phani in forum Networking
    Replies: 4
    Last Post: 10-12-2010, 06:15 PM
  2. Replies: 2
    Last Post: 07-15-2008, 06:11 PM
  3. Sql server connection problem
    By tanvirtonu in forum JDBC
    Replies: 1
    Last Post: 03-31-2008, 12:46 PM
  4. Checking of file was modified on the server
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 03-02-2008, 07:18 PM
  5. SQL Server 2005 Jdbc connection
    By mgt83 in forum JavaServer Pages (JSP) and JSTL
    Replies: 0
    Last Post: 07-27-2007, 04:52 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
  •