Example #1
0
 public static void CopyFileOrDirectory(string source, string dest)
 {
     FileUtil.CheckForValidSourceAndDestinationArgumentsAndRaiseAnExceptionWhenNullOrEmpty(source, dest);
     if (FileUtil.PathExists(dest))
     {
         throw new IOException(string.Format("Failed to Copy File / Directory from '{0}' to '{1}': destination path already exists.", source, dest));
     }
     if (!FileUtil.CopyFileOrDirectoryInternal(source, dest))
     {
         throw new IOException(string.Format("Failed to Copy File / Directory from '{0}' to '{1}'.", source, dest));
     }
 }