Solved

Java: Read a shortcut file present in network drive

Posted on 2011-03-09
3
633 Views
Last Modified: 2013-11-23
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
Comment
Question by:gpmattoo8
  • 2
3 Comments
 
LVL 47

Expert Comment

by:for_yan
ID: 35080413
If it is in C:\param\bin why would not you read it as File f = new File("c:\\Param\\bin\\mart.xml"); - ?
0
 
LVL 1

Expert Comment

by:DColclazier
ID: 35080452
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
 
LVL 47

Accepted Solution

by:
for_yan earned 50 total points
ID: 35080544
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

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

778 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question