public static bool Copy(String source, String target)
{
bool retVal = true;
try
{
var fileAttr = File.GetAttributes(source);
if ((fileAttr & FileAttributes.Directory) == FileAttributes.Directory)
{
retVal = CopyDir(source, target, true);
}
else
{
File.Copy(source, target, true);
}
}
catch (Exception ex)
{
Log.Debug(ex.ToString());
retVal = false;
}
return retVal;
}