BlogEngine.Core.Providers.UNCFileSystemProvider.GetFile C# (CSharp) Method

GetFile() public method

gets a specific file by virtual path
public GetFile ( string VirtualPath ) : FileSystem.File
VirtualPath string the virtual path of the file
return FileSystem.File
        public override FileSystem.File GetFile(string VirtualPath)
        {
            VirtualPath = CleanVirtualPath(VirtualPath);
            var aPath = VirtualPathToUNCPath(VirtualPath);
            var sysFile = new FileInfo(aPath);
            if (!sysFile.Exists)
                throw new FileNotFoundException("The file at " + VirtualPath + " was not found.");

            var file = new FileSystem.File
            {
                FullPath = VirtualPath,
                Name = sysFile.Name,
                DateModified = sysFile.LastWriteTime,
                DateCreated = sysFile.CreationTime,
                Id = Guid.NewGuid().ToString(),
                LastAccessTime = sysFile.LastAccessTime,
                ParentDirectory = GetDirectory(VirtualPath.Substring(0, VirtualPath.LastIndexOf("/"))),
                FilePath = VirtualPath,
                FileSize = sysFile.Length,
            };
            return file;
        }