Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

reading unc file  RSS feed

 
Rao Kumar
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Do you know how to read a file that has a unc name?

I tried using URL class in this form:

new URL("file://server/path/file.txt");

but getting Connection refused error. Not sure if this is a security issue or incorrect java class I'm using.

Thanks, rK
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use local paths. If you're working with servlets, use ServletContext.getRealPath("foldername");
[ October 10, 2006: Message edited by: Bauke Scholtz ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!