• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 651
  • Last Modified:

Java: Read a shortcut file present in network drive

File f = new File("\\\\bady\\SShare\\mart.xml");
Here mart.xml is a shortcut present in C:\Param\Bin
I get a java.io.FileNotFoundException:\\\\bady\\SShare\\mart.xml (The system cannot find the file specified)
0
gpmattoo8
Asked:
gpmattoo8
  • 2
1 Solution
 
for_yanCommented:
If it is in C:\param\bin why would not you read it as File f = new File("c:\\Param\\bin\\mart.xml"); - ?
0
 
DColclazierCommented:
They are probably trying to reference the network location rather than a local logical drive - makes sense.  Can you access the file via alternate methods (explorer) using the same UNC?
0
 
for_yanCommented:
You need either map some part of the UNC path as a drive (under some letter) or, I guess, you can open stream from URL using file: protocol:
file://bady/SShare/mart.xml
I didn't try the last variant but hope it should work analogously to http: proticol, but does not need http server
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now