---
title: "JAVA File URL平台兼容性"
author: "hellojava"
date: "2018-05-22T17:40:54Z"
tags: []
categories: ["编程语言"]
slug: "java-file-url"
draft: false
lastmod: "2018-05-22T17:40:54Z"
id: 2423312
url: "https://hellojava.iteye.com/blog/2423312"
---

```
URL 
File file=new File("");
file.toURL();
此处windows和linux有不同
windows: file:/C:/work/chandan/deepak.txt
linux: file:/data/deepak.tx
```