public static void CopyFolder(SPath fromPath, SPath toPath) { Logger.Trace("CopyFolder from {0} to {1}", fromPath, toPath); toPath.DeleteIfExists(); toPath.EnsureParentDirectoryExists(); fromPath.Move(toPath); }
public static void Copy(SPath fromPath, SPath toPath) { Logger.Trace("Copying from {0} to {1}", fromPath, toPath); try { CopyFolder(fromPath, toPath); } catch (Exception ex1) { Logger.Warning(ex1, "Error copying."); try { CopyFolderContents(fromPath, toPath); } catch (Exception ex2) { Logger.Error(ex2, "Error copying contents."); throw; } } finally { fromPath.DeleteIfExists(); } }
protected override void RaiseOnEnd() { tempFile.DeleteIfExists(); base.RaiseOnEnd(); }