java.io.NotSerializableException: sun.nio.fs.WindowsPath - how to fix it?

和自甴很熟 提交于 2019-12-24 10:50:03

问题


I wrote a simple serialization function in order to store a fileTree representation (based on the composite pattern...), but always get following error:

        java.io.NotSerializableException: sun.nio.fs.WindowsPath

Unfortunately I couldn't figure out so far how to fix that - anyone else encountered that?


回答1:


Serialize it as a String instead of a Path.



来源:https://stackoverflow.com/questions/26011679/java-io-notserializableexception-sun-nio-fs-windowspath-how-to-fix-it

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!