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

gdj980150 2004-11-24 09:09:03
我使用这个方法怎么不能修改文件名呀???
...全文
184 3 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
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

81,122

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧