开发者

What is the difference between file:/, file://, file:///

开发者 https://www.devze.com 2023-01-13 19:23 出处:网络
Today I saw in a Java application several different approaches to开发者_运维技巧 load a file.

Today I saw in a Java application several different approaches to开发者_运维技巧 load a file.

  • file:/
  • file://
  • file:///

What is the difference of these three URL beginnings and what is the preferred way of using them?

Thanks a lot Stefan


  • file:/ is invalid as far as I know

  • file:// is the prefix for the file protocol

  • file:/// is the prefix for the file protocol, plus a leading / pointing to the root directory of the current drive (On Windows) or the overall root directory (On Linux / Unix).


file:/ is invalid, and shouldn't work file:/// is a shorthand for: file://localhost/ file:// is the recommended method

0

精彩评论

暂无评论...
验证码 换一张
取 消