throw new IOException("can't rename file '" + src.getAbsolutePath() + "' : file doesn't exist.");
throw new IOException("can't rename file '" + src.getAbsolutePath() + "' : file doesn't exist");
    public static void rename(File src, File dst) throws IOException {        if (!src.exists()) {            throw new IOException("can't rename file '" + src.getAbsolutePath() + "' : file doesn't exist.");        }        if (dst.isDirectory()) {            throw new IOException("can't overwrite file '" + dst.getAbsolutePath() + "' : it is a directory.");        }        boolean renamed = src.renameTo(dst);        if (!renamed) {            if (dst.exists()) {                boolean deleted = dst.delete();                if (!deleted || dst.exists()) {                    throw new IOException("can't overwrite file '" + dst.getAbsolutePath() + "'.");                }            }            if (!src.renameTo(dst)) {                throw new IOException("can't rename file '" + src.getAbsolutePath() + "'.");            }        }    }