Ahmed Junaid
Ahmed Junaid

Reputation: 79

File is not accessing in java

File file = new File("\\10.200.64.8\\home\\rbts\\IBST000826");
FileInputStream fin = new FileInputStream(file);

is giving error , I have tried also as

File file = new File("file:\\10.200.64.8\\home\\rbts\\IBST000826"); 

and

File file = new File(new URI("file:////10.200.64.8/home/rbts/IBST000826"));

the file is on linux machine and i m accessing it on windows machine. Can any body give suggestion or solution.

java.io.FileNotFoundException: \10.200.64.8\home\rbts\IBST000826 (The system cannot find the path specified)
    at java.io.FileInputStream.open(Native Method)
    at java.io.FileInputStream.<init>(Unknown Source)
    at com.sapphire.oracle.osb.hbl.isohandler.utils.ISO_MessageUtils.getFileContent(ISO_MessageUtils.java:350)
    at com.sapphire.oracle.osb.hbl.isohandler.utils.ISO_MessageUtils.main(ISO_MessageUtils.java:366)

Upvotes: 1

Views: 98

Answers (1)

hmjd
hmjd

Reputation: 122001

Change to:

File file = new File("\\\\10.200.64.8\\home\\rbts\\IBST000826");
                    //^^^^

to ensure \\ in file path.

Upvotes: 2

Related Questions