• Post Reply Bookmark Topic Watch Topic
  • New Topic

Connection to file server

 
Luis Lopez Coronado
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Rob Spoor
Sheriff
Posts: 20820
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Perhaps JCIFS will be able to help you out.
 
Luis Lopez Coronado
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Rob, i got connect to the server with JAAS NtlmLoginModule (JaasLounge Project) based on JCIFS and JCIFS-ext project. Thanks a lot
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!