欢迎访问悦橙教程(wld5.com),关注java教程。悦橙教程  java问答|  每日更新
页面导航 : > > 文章正文

java实现移动文件夹代码,java文件夹代码,// This will

来源: javaer 分享于  点击 39906 次 点评:42

java实现移动文件夹代码,java文件夹代码,// This will


// This will not move files across drives.    // File (or directory) to be moved    File file = new File("filename");    // Destination directory    File dir = new File("directoryname");    // Move file to new directory    boolean success = file.renameTo(new File(dir, file.getName()));    if (!success) {        // File was not successfully moved    }//该片段来自于http://byrx.net
相关栏目:

用户点评