Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-17-2008, 03:22 AM
Member
 
Join Date: May 2008
Posts: 3
luislopezco is on a distinguished road
[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
Sponsored Links
  #2 (permalink)  
Old 05-18-2008, 10:20 AM
danielstoner's Avatar
Senior Member
 
Join Date: Apr 2008
Location: Canada
Posts: 183
danielstoner is on a distinguished road
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, 02:39 AM
Member
 
Join Date: May 2008
Posts: 3
luislopezco is on a distinguished road
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, 08:00 AM
danielstoner's Avatar
Senior Member
 
Join Date: Apr 2008
Location: Canada
Posts: 183
danielstoner is on a distinguished road
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
Sponsored Links
Reply


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

vB 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
To transfer a file from client to server phani Networking 1 04-16-2008 02:39 AM
Sql server connection problem tanvirtonu Database 1 03-31-2008 01:46 PM
Checking of file was modified on the server Java Tip Java Tips 0 03-02-2008 08:18 PM
Web-App server connection - How to hit the particular app server from the web server maruthi_s Enterprise JavaBeans 1 01-06-2008 01:32 PM
SQL Server 2005 Jdbc connection mgt83 JavaServer Pages (JSP) and JSTL 0 07-27-2007 05:52 AM


All times are GMT +3. The time now is 04:55 AM.


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