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

前端 未结 2 835
轮回少年
轮回少年 2020-12-31 05:18

Today I saw in a Java application several different approaches to load a file.

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

What is the differen

相关标签:
2条回答
  • 2020-12-31 05:37
    • 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).

    0 讨论(0)
  • 2020-12-31 05:38

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

    0 讨论(0)
提交回复
热议问题