Local file protocol for java.net.URL

后端 未结 2 582
难免孤独
难免孤独 2020-12-06 11:32

What\'s the protocol for local files using URL? I\'ve downloaded a file using Java and I need to know how to access it, not using File, but using URL.

2条回答
  •  粉色の甜心
    2020-12-06 11:41

    Unix

    file://localhost/
    file:///
    

    Windows

    file://localhost/|/
    file:///|/
    file://localhost/:/
    file:///:/
    

    For more information see the related Wikipedia article.

提交回复
热议问题