file:/, file://, file:///有什么区别 [英] What is the difference between file:/, file://, file:///

查看:142
本文介绍了file:/, file://, file:///有什么区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

今天我在 Java 应用程序中看到了几种不同的加载文件的方法.

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

  • 文件:/
  • file://
  • file:///

这三个 URL 开头的区别是什么?使用它们的首选方式是什么?

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

非常感谢斯蒂芬

推荐答案

  • file:/ 据我所知是无效的

    file:// 是文件协议的前缀

    file:/// 是文件协议的前缀,加上前导 / 指向当前驱动器的根目录(在 Windows 上)或整个根目录(在 Linux/Unix 上).

    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:/, file://, file:///有什么区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆