src/org/kocakosm/pitaya/io/XFiles.java
public static void cp(File src, File dst) throws IOException
	{
		if (!src.exists()) {
			throw new FileNotFoundException(src + " doesn't exist");
		}
		Parameters.checkCondition((!dst.exists() || dst.isDirectory())
			|| (src.isFile() && dst.isFile()));
		if (src.isDirectory()) {
			copyDirectory(src, dst);
		} else if (src.isFile()) {
			copyFile(src, dst);
		} else {
			throw new IOException(
				src + " is neither a directory nor a regular file");
		}
	}
public static void cp(File src, File dst) throws IOException
	{
		if (!src.exists()) {
			throw new FileNotFoundException(src + " doesn't exist");
		}
		Parameters.checkCondition((!dst.exists() || dst.isDirectory())
			|| (src.isFile() && dst.isFile()));
		if (src.isDirectory()) {
			copyDirectory(src, dst);
		} else if (src.isFile()) {
			copyFile(src, dst);
		} else {
			throw new IOException(
				src + " is neither a directory nor a regular file");
		}
	}
public static void cp ( File src , File dst ) throws IOException { if ( ! src . exists ( ) ) { throw new FileNotFoundException ( src + " doesn't exist" ) ; } Parameters . checkCondition ( ( ! dst . exists ( ) || dst . isDirectory ( ) ) || ( src . isFile ( ) && dst . isFile ( ) ) ) ; if ( src . isDirectory ( ) ) { copyDirectory ( src , dst ) ; } else if ( src . isFile ( ) ) { copyFile ( src , dst ) ; } else { throw new IOException ( src + " is neither a directory nor a regular file" ) ; } }
Copies the contents of {@code src} to {@code dst}. If {@code dst}
doesn't exist, it will be created. If it already exists, it can be
either a directory or a regular file if {@code src} is also a regular
file. Named after the Unix command of the same name.

@param src the source {@code File}.
@param dst the target {@code File}.

@throws NullPointerException if one of the arguments is {@code null}.
@throws IllegalArgumentException if {@code src} is a directory and
{@code dst} is a regular file.
@throws IOException if {@code src} doesn't exist or if {@code src} is
neither a regular file nor a directory or if an I/O error occurs
during the process.
@throws SecurityException if a security manager exists and denies
read access to {@code src} or write access to {@code dst}.
Copies the contents of { @code src } to { @code dst } . If { @code dst } doesn t exist it will be created . If it already exists it can be either a directory or a regular file if { @code src } is also a regular file . Named after the Unix command of the same name .