java.io.File中renameTo()。。。

gdj980150 2004-11-24 09:09:03
我使用这个方法怎么不能修改文件名呀???
...全文
130 点赞 收藏 3
写回复
3 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
gdj980150 2004-12-01
我自己解决了,怎么结帖????
回复
gdj980150 2004-11-24
谁能给翻译一下,谢谢
回复
williamy 2004-11-24
renameTo
public boolean renameTo(File dest)Renames the file denoted by this abstract pathname.
Whether or not this method can move a file from one filesystem to another is platform-dependent. The return value should always be checked to make sure that the rename operation was successful.

Parameters:
dest - The new abstract pathname for the named file
Returns:
true if and only if the renaming succeeded; false otherwise
Throws:
SecurityException - If a security manager exists and its SecurityManager.checkWrite(java.lang.String) method denies write access to either the old or new pathnames
NullPointerException - If parameter dest is null

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~williamy
回复
相关推荐
发帖
Web 开发
创建于2007-09-28

8.0w+

社区成员

Java Web 开发
申请成为版主
帖子事件
创建了帖子
2004-11-24 09:09
社区公告
暂无公告