复制文件与空间 [英] Copying Files with Spaces

查看:77
本文介绍了复制文件与空间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想一个文件复制到另一个目录,但在源路径与中有空格的目录,我复制文件的方式是行不通的,例如

I'm trying to copy one file to another directory, but the way I am copying the file is not working when the source path has a directory with spaces in it, e.g.

/Volumes/public/Music/Directory With Spaces/01.mp3

我使用: http://commons.apache.org/io/

我找不到解决的办法,任何想法?

I can't find a way around this, any ideas?

编辑:这个问题也许应该把带有空格的路径进入的java.io.File对象

The problem should probably be putting paths with spaces into a java.io.File object.

推荐答案

如果您使用的是1.1版,那么你应该能够使用%20指的空间。

If you are using version 1.1, then you should be able to use '%20' to refer to a space.

来源: http://commons.apache.org/io/upgradeto1%5F1。 HTML

这篇关于复制文件与空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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