public static long sizeOf(final File file) {

        if (!file.exists()) {
            final String message = file + " does not exist";
            throw new IllegalArgumentException(message);
        }

        if (file.isDirectory()) {
            return sizeOfDirectory0(file); // private method; expects directory
        } else {
            return file.length();
        }

    }
Moves a file.
<p>
When the destination file is on another file system, do a "copy and delete".

@param srcFile  the file to be moved
@param destFile the destination file
@throws NullPointerException if source or destination is {@code null}
@throws IOException  if the destination file exists
@throws IOException          if source or destination is invalid
@throws IOException          if an IO error occurs moving the file
replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/replugin/utils/FileUtils.java