示例#1
0
 public static void CopyFolder(SPath fromPath, SPath toPath)
 {
     Logger.Trace("CopyFolder from {0} to {1}", fromPath, toPath);
     toPath.DeleteIfExists();
     toPath.EnsureParentDirectoryExists();
     fromPath.Move(toPath);
 }
示例#2
0
        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();
            }
        }
示例#3
0
 protected override void RaiseOnEnd()
 {
     tempFile.DeleteIfExists();
     base.RaiseOnEnd();
 }