BlogEngine.Core.Providers.XmlFileSystemProvider.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 = RelativeFilePath(VirtualPath);
            var aPath = BlogAbsolutePath(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 = VirtualPath.Replace(Blog.CurrentInstance.RootFileStore.FullPath, ""),
                LastAccessTime = sysFile.LastAccessTime,
                ParentDirectory = GetDirectory(VirtualPath.Substring(0, VirtualPath.LastIndexOf("/"))),
                FilePath = VirtualPath.Replace(Blog.CurrentInstance.RootFileStore.FullPath, ""),
                FileSize = sysFile.Length,
            };
            return file;
        }