Solved

Java: Read a shortcut file present in network drive

Posted on 2011-03-09
3
629 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
Comment Utility
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
Comment Utility
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
Comment Utility
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

763 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now