Hi there,
Can anyone help me with this -
I am trying to read a remote file.
Because my responseReader.readLine() method fails when it is an XL file (gives an error), so I was trying to replace the code and use FileReader instead.
So, I modified the code as follows -
But I am always getting a FileNotFoundException. When I debug the value of "file" object = "http:/devo.mim.com.au:3333/fetch/:1715327", which is incorrect as the "file" object should have been "http://devo.mim.com.au:3333/fetch/:1715327".
Somehow the double forward slash has been converted to a single forward slash.
I had tried to modify the sourceFileURL as follows -
1) sourceFileURL="http:////" + serverName + ":" + serverPort + autoLoginPath + "/:" + mDoc.getId();
2) sourceFileURL="http:\/\/" + serverName + ":" + serverPort + autoLoginPath + "/:" + mDoc.getId();
3) sourceFileURL="http:" + File.separator + File.separator + serverName + ":" + serverPort + autoLoginPath + "/:" + mDoc.getId();
The sourceURL would give me a correct value which is where the document exists "http://devo.mim.com.au:3333/fetch/:1715327", but as soon as the object file was created using the File constructor which takes
string as a parameter, File file = new File(sourceFileURL) it would give an incorrect value of "http:/devo.mim.com.au:3333/fetch/:1715327" and so throw a FileNotFoundException.
I also tried to modify the file constructor with various options as follows but none of them has helped me.
1) File file = new File(sourceFileURL);
2) File file = new File("http:" + File.separator + File.separator + serverName + ":" + serverPort + autoLoginPath + "/:" + mDoc.getId());
Can someone please advise me on how to escape the forward slash while creating a remote file object?
Thanks in advance!
Any help much appreciated!!
Best Regards,
Jyotsna Pai