Java Utililty Methods File Move

List of utility methods to do File Move

Description

The list of methods to do File Move are organized into topic(s).

Method

voidmove(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"),
...
booleanmoveTo(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));