Class MappedResourceInfo
Contains information about a resource served via an IFileProvider.
Inherited Members
Namespace: EmbedIO.Files
Syntax
public sealed class MappedResourceInfo
Properties
ContentType
If IsDirectory is false, gets a MIME type describing the kind of contents of the file.
If IsDirectory is true, this property is always null.
Declaration
public string ContentType { get; }
Property Value
Type | Description |
---|---|
String |
IsDirectory
Gets a value indicating whether this instance represents a directory.
Declaration
public bool IsDirectory { get; }
Property Value
Type | Description |
---|---|
Boolean |
IsFile
Gets a value indicating whether this instance represents a file.
Declaration
public bool IsFile { get; }
Property Value
Type | Description |
---|---|
Boolean |
LastModifiedUtc
Gets the UTC date and time of the last modification made to the resource.
Declaration
public DateTime LastModifiedUtc { get; }
Property Value
Type | Description |
---|---|
DateTime |
Length
If IsDirectory is false, gets the length of the file, expressed in bytes.
If IsDirectory is true, this property is always zero.
Declaration
public long Length { get; }
Property Value
Type | Description |
---|---|
Int64 |
Name
Gets the name of the resource, as it would appear in a directory listing.
Declaration
public string Name { get; }
Property Value
Type | Description |
---|---|
String |
Path
Gets a unique, provider-specific path for the resource.
Declaration
public string Path { get; }
Property Value
Type | Description |
---|---|
String |
Methods
ForDirectory(String, String, DateTime)
Creates and returns a new instance of the MappedResourceInfo class, representing a directory.
Declaration
public static MappedResourceInfo ForDirectory(string path, string name, DateTime lastModifiedUtc)
Parameters
Type | Name | Description |
---|---|---|
String | path | A unique, provider-specific path for the directory. |
String | name | The name of the directory, as it would appear in a directory listing. |
DateTime | lastModifiedUtc | The UTC date and time of the last modification made to the directory. |
Returns
Type | Description |
---|---|
MappedResourceInfo | A newly-constructed instance of MappedResourceInfo. |
ForFile(String, String, DateTime, Int64, String)
Creates and returns a new instance of the MappedResourceInfo class, representing a file.
Declaration
public static MappedResourceInfo ForFile(string path, string name, DateTime lastModifiedUtc, long size, string contentType)
Parameters
Type | Name | Description |
---|---|---|
String | path | A unique, provider-specific path for the file. |
String | name | The name of the file, as it would appear in a directory listing. |
DateTime | lastModifiedUtc | The UTC date and time of the last modification made to the file. |
Int64 | size | The length of the file, expressed in bytes. |
String | contentType | A MIME type describing the kind of contents of the file. |
Returns
Type | Description |
---|---|
MappedResourceInfo | A newly-constructed instance of MappedResourceInfo. |