Not able to read files from mapped drive

Hi. My application takes two files as input using "Browse" option. Application runs fine on local machine but when i deploy the application on remote machine and browse the input files kept on mapped drives, i get "FileNotFound Exception". Basically, application is not able to read files kept in mapped drives. Please advice. ( I have access to mapped drives ONLY). Thanks.

[381 byte] By [Mayank_03a] at [2007-11-27 10:46:33]
# 1

In which format did you include your filename?

Was it like this(supposing your drive to be C:):

"C:\\filename.file-extension" if that is so then include two more \\in the path as "C:\\\\filename.file-extension". That should fix it.

subhashmedhia at 2007-7-28 20:19:34 > top of Java-index,Java Essentials,Java Programming...
# 2

Hi. I tried this but it did not work. I am trying to browse the file as

Y:\MyFolder\abc.xml ,where, Y is a mapped drive

Mayank_03a at 2007-7-28 20:19:34 > top of Java-index,Java Essentials,Java Programming...
# 3

"Y:\\\\MyFolder\\\\abc.xml".try this.

http://www.exampledepot.com/egs/java.sql/LoadFileToMySqlTable.html

subhashmedhia at 2007-7-28 20:19:34 > top of Java-index,Java Essentials,Java Programming...
# 4

no luck

Mayank_03a at 2007-7-28 20:19:34 > top of Java-index,Java Essentials,Java Programming...
# 5

Someone please suggest a solution !!

Mayank_03a at 2007-7-28 20:19:34 > top of Java-index,Java Essentials,Java Programming...
# 6

show your code first.

subhashmedhia at 2007-7-28 20:19:34 > top of Java-index,Java Essentials,Java Programming...
# 7

how about

Y:/MyFolder/abc.xml

sino_yonga at 2007-7-28 20:19:34 > top of Java-index,Java Essentials,Java Programming...
# 8

Please post a brief (no more than a dozen line) program that illustrates your problem.

pbrockway2a at 2007-7-28 20:19:34 > top of Java-index,Java Essentials,Java Programming...
# 9

that is what i tried first...... Y: is mapped drive and is not able to synchronize between the two m/c's (one where files are kept and other where app is deployed

Mayank_03a at 2007-7-28 20:19:34 > top of Java-index,Java Essentials,Java Programming...
# 10

i am just reading a file. Getting Exception when the file is on remote m/c and the path i give to browse it say Y:/Myfile.xml ......Y drive is a mapped drive

File file = new File(f);

String [][] fileHeader = new String [5][200];

HashMap data = new HashMap();

try {

in = new BufferedReader(new FileReader(f));

String strHeader = in.readLine();

MyTokenizer mtHead=new MyTokenizer();

String [] a = mtHead.mySplit(strHeader);

colsInHeader= a.length;

}

catch (FileNotFoundException e) {

log.info("Cannot find input file.........");

}

Mayank_03a at 2007-7-28 20:19:34 > top of Java-index,Java Essentials,Java Programming...
# 11

That doesn't illustrate the problem because it does not compile.

Remove the code that has no bearing on the problem and add some code to output file and whether it exists, is a file etc. Also output and post the stack trace of the exception as it may provide you with further information.

Also make sure you can access the file from the command line - ie that there aren't problems with permissions.

pbrockway2a at 2007-7-28 20:19:34 > top of Java-index,Java Essentials,Java Programming...
# 12

hi... I cannot access the file on remote desktop using command prompt because the remote desktop that i have does not give me the option for command prompt.... file i am passing as parameter to readFile function is on a mapped drive of another machine. so issue lies here and i am getting the filenotfound exception

Mayank_03a at 2007-7-28 20:19:35 > top of Java-index,Java Essentials,Java Programming...