List of utility methods to do File Move
void | move(File from, File to, boolean overwrite) Move a file from one location to another. if (to.exists()) { if (overwrite) { if (!to.delete()) { throw new IOException(MessageFormat.format(labels.getString("delete" + "error"), (Object[]) new String[] { to.toString() })); } else { throw new IOException(MessageFormat.format(labels.getString("already" + "exists" + "error"), ... |
boolean | moveTo(File file, String distDir) move To String path = parsePath(distDir); checkDir(path); String filePath = (path.endsWith(File.separator)) ? path + file.getName() : path + File.separator + file.getName(); return file.renameTo(new File(filePath)); |