Solved

Java: Read a shortcut file present in network drive

Posted on 2011-03-09
3
639 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Glassfish admin console not working 1 88
Selenium docs api java index 3 97
Java program running SQL query 5 64
Netbeans and org.apache.commons.lang3 issue 3 53
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
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…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Suggested Courses

734 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