使用空格复制文件 [英] Copying Files with Spaces

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

问题描述

我试图将一个文件复制到另一个目录,但是我复制该文件的方式不工作,当源路径有一个目录,其中有空格,例如

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


b $ b

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



我不能找到一个办法,任何想法?



编辑:问题应该是把带空格的路径放入java.io.File对象。 p>

解决方案

如果您使用的是1.1版本,那么您应该可以使用%20来引用空格。 >

资料来源: http://commons.apache。 org / io / upgradeto1_1.html


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

I am using: http://commons.apache.org/io/

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

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

解决方案

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

Source: http://commons.apache.org/io/upgradeto1_1.html

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

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