How to read a file from remote system using java?

后端 未结 8 1120
忘了有多久
忘了有多久 2020-12-06 05:18

I have a file copied in one computer and I need to access the file from other computer. I am not sure, which protocol or which technology to use for this? Please provide me

8条回答
  •  南笙
    南笙 (楼主)
    2020-12-06 06:17

    You could try to mount that path first, and then load it. Do a :

    subst x: \\192.168.1.157
    

    and then:

    File f = new File("x:\\home\\renjith\\picture.jpg");
    Image image = ImageIO.read(f)
    

    It should work.

提交回复
热议问题