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]

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.
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
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.........");
}
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.