本人在研究java中的File类的代码实现时 在看到list()这个函数时候 其源码为
public String[] list() {
SecurityManager security = System.getSecurityManager();
if (security != null) {
    security.checkRead(path);
}
return fs.list(this);
    }
最后一行代码中的fs 是有 static private FileSystem fs = FileSystem.getFileSystem();声明的。
但是FileSystem这个类java API中没有  我在看FileSystem.java的code时候发现getFileSystem()为抽象方法没有实现。
所以小弟比较迷惑不知道哪里能看见其具体实现的代码。
小弟想研究一下,谢啦。

解决方案 »

  1.   


    public static native FileSystem getFileSystem();应该是native的code,没有代码。
      

  2.   

    很不幸这应该是JNI实现,应该木有Java源码。获取能找到C++的源码 =_+
      

  3.   

    好吧,谢谢楼上2位。最近在看lucene 在研究其搜索本地txt文档时研究这些code 想探其究竟看看它到底是怎么实现的搜索功能。
      

  4.   

    File中的 getCanonicalPath这些关键的获取文件路径的代码都看不见具体代码实现。呵呵。坑爹呀
      

  5.   

    native的方法 说明 ,这个 可能不是java语言的额了