Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more

Class ZipArchiveFileProvider

A Microsoft.Extensions.FileProviders.IFileProvider that will serve the contents of a zip archive as a virtual file system.

Inheritance
System.Object
ZipArchiveFileProvider
Implements
Microsoft.Extensions.FileProviders.IFileProvider
System.IDisposable
Namespace: EPiServer.Web.Hosting
Assembly: EPiServer.Framework.AspNetCore.dll
Version: 12.0.3
Syntax
public class ZipArchiveFileProvider : Object, IBasePathFileProvider, IFileProvider, IDisposable

Constructors

ZipArchiveFileProvider(String, String)

Initializes a new instance of the ZipArchiveFileProvider class.

Declaration
public ZipArchiveFileProvider(string virtualPath, string archivePath)
Parameters
Type Name Description
System.String virtualPath

The virtual path that should be mapped by the provider

System.String archivePath

Relative or absolute path to the zip archive file

ZipArchiveFileProvider(String, String, String)

Initializes a new instance of the ZipArchiveFileProvider class.

Declaration
public ZipArchiveFileProvider(string virtualPath, string archivePath, string archiveBasePath)
Parameters
Type Name Description
System.String virtualPath

The virtual path that should be mapped by the provider

System.String archivePath

Relative or absolute path to the zip archive file

System.String archiveBasePath

The base path inside the zip archive that should be use. e.g. if you want to make any subfolder as the base path

Properties

BasePath

Base path for file provider

Declaration
public string BasePath { get; }
Property Value
Type Description
System.String

Methods

ClearResources()

Empties the in-memory data and loaded archive

Declaration
public void ClearResources()

Dispose()

Cleanup for ZipArchiveFileProvider

Declaration
public void Dispose()

Dispose(Boolean)

Cleanup for ZipArchiveFileProvider

Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type Name Description
System.Boolean disposing

Finalize()

Distructor for ZipArchiveFileProvider

Declaration
protected override void Finalize()

GetDirectory(String)

Returns the virtual folder by given virtual directory path

Declaration
public IFileInfo GetDirectory(string virtualDir)
Parameters
Type Name Description
System.String virtualDir

The virtual path to the directory

Returns
Type Description
Microsoft.Extensions.FileProviders.IFileInfo

GetDirectoryContents(String)

Returns content of a directory

Declaration
public IDirectoryContents GetDirectoryContents(string subpath)
Parameters
Type Name Description
System.String subpath

The directory to return content of

Returns
Type Description
Microsoft.Extensions.FileProviders.IDirectoryContents

The directorys content

GetFile(String)

Returns the mapped file if there is one; otherwise fall back to the base implementation

Declaration
public IFileInfo GetFile(string virtualPath)
Parameters
Type Name Description
System.String virtualPath

Path to the file

Returns
Type Description
Microsoft.Extensions.FileProviders.IFileInfo

A virtual file if one exists; otherwise null

GetFileInfo(String)

Get info of a file

Declaration
public IFileInfo GetFileInfo(string subpath)
Parameters
Type Name Description
System.String subpath

Path to the file

Returns
Type Description
Microsoft.Extensions.FileProviders.IFileInfo

A FileInfo

Watch(String)

Watches files for changes

Declaration
public IChangeToken Watch(string filter)
Parameters
Type Name Description
System.String filter

Filter file names

Returns
Type Description
Microsoft.Extensions.Primitives.IChangeToken

Implements

Microsoft.Extensions.FileProviders.IFileProvider
System.IDisposable

Extension Methods