Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-17-2008, 02:22 AM
Member
 
Join Date: May 2008
Posts: 3
Rep Power: 0
luislopezco is on a distinguished road
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
Bookmark Post in Technorati
Reply With Quote
  #2 (permalink)  
Old 05-18-2008, 09:20 AM
danielstoner's Avatar
Senior Member
 
Join Date: Apr 2008
Location: Canada
Posts: 191
Rep Power: 2
danielstoner is on a distinguished road
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 @ [
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
]
Language is froth on the surface of thought
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 05-21-2008, 01:39 AM
Member
 
Join Date: May 2008
Posts: 3
Rep Power: 0
luislopezco is on a distinguished road
Default
Thanks danielstoner,
i got connect to the server with Jaas NtlmLoginModule (JaasLounge project).
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 05-21-2008, 07:00 AM
danielstoner's Avatar
Senior Member
 
Join Date: Apr 2008
Location: Canada
Posts: 191
Rep Power: 2
danielstoner is on a distinguished road
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 @ [
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
]
Language is froth on the surface of thought
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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 On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Web-App server connection - How to hit the particular app server from the web server maruthi_s Enterprise JavaBeans 2 07-15-2008 06:11 PM
To transfer a file from client to server phani Networking 1 04-16-2008 01:39 AM
Sql server connection problem tanvirtonu Database 1 03-31-2008 12:46 PM
Checking of file was modified on the server Java Tip Java Tips 0 03-02-2008 07:18 PM
SQL Server 2005 Jdbc connection mgt83 JavaServer Pages (JSP) and JSTL 0 07-27-2007 04:52 AM


All times are GMT +2. The time now is 09:47 AM.



VBulletin, Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2009, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org