/// <summary> /// get full file path according to the specified file name /// </summary> /// <param name="fileName">File name</param> /// <param name="blobName">Source blob name</param> /// <param name="snapshotTime">Source blob snapshot time</param> /// <returns>full file path if file path is valid, otherwise throw an exception</returns> internal string GetFullReceiveFilePath(string fileName, string blobName, DateTimeOffset?snapshotTime) { String filePath = Path.Combine(CurrentPath(), fileName); fileName = Path.GetFileName(filePath); String dirPath = Path.GetDirectoryName(filePath); if (!String.IsNullOrEmpty(dirPath) && !Directory.Exists(dirPath)) { throw new ArgumentException(String.Format(Resources.DirectoryNotExists, dirPath)); } if (string.IsNullOrEmpty(fileName) || Directory.Exists(filePath)) { fileName = fileNameResolver.ResolveFileName(blobName, snapshotTime); filePath = Path.Combine(filePath, fileName); } fileName = Path.GetFileName(filePath); if (!NameUtil.IsValidFileName(fileName)) { throw new ArgumentException(String.Format(Resources.InvalidFileName, fileName)); } //there is no need to check the read/write permission on the specified file path, the datamovement libraray will do that return(filePath); }