示例#1
0
        /// <summary>
        /// 移動。
        /// </summary>
        /// <param name="destDir">移動先。</param>
        /// <param name="overwrite">上書き可。</param>
        public void MoveTo(TraceableDirectory destDir, bool overwrite)
        {
            destDir.Create();

            // Trace.WriteLine($"{LogHelper.Stamp}Move    : '{this.FullName}' --into--> '{destDir.FullName}' directory...");
            var dstFile = new TraceableFile(PathHelper.Combine(destDir.FullName, Path.GetFileName(this.FullName)));

            this.MoveTo(dstFile, overwrite);
        }
示例#2
0
        /// <summary>
        /// 親ディレクトリの作成。
        /// </summary>
        public void CreateParentDirectory()
        {
            var parentFullName = string.Empty;

            try
            {
                parentFullName = System.IO.Directory.GetParent(this.FullName).FullName;
                var wentParentDir = new TraceableDirectory(parentFullName);
                wentParentDir.Create();
            }
            catch (NotSupportedException e)
            {
                Trace.WriteLine($"{LogHelper.Stamp}ThisFullName: '{this.FullName}'. FullName: '{parentFullName}'. {e}");
                throw;
            }
        }