Class ZipArchiveVirtualPathProvider

A System.Web.Hosting.VirtualPathProvider that will serve the contents of a zip archive as a virtual file system.

Inheritance
System.Object
ZipArchiveVirtualPathProvider
Implements
System.IDisposable
Namespace: EPiServer.Web.Hosting
Assembly: EPiServer.Framework.dll
Version: 8.11.0
Syntax
public class ZipArchiveVirtualPathProvider : VirtualPathProvider, IDisposable

Constructors

ZipArchiveVirtualPathProvider(String, String)

Initializes a new instance of the ZipArchiveVirtualPathProvider class.

Declaration
public ZipArchiveVirtualPathProvider(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

ZipArchiveVirtualPathProvider(String, String, String)

Initializes a new instance of the ZipArchiveVirtualPathProvider class.

Declaration
public ZipArchiveVirtualPathProvider(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

Methods

ClearResources()

Empties the in-memory data and loaded archive

Declaration
public void ClearResources()

DirectoryExists(String)

Returns true if the given virtual path exists as a Folder inside the zip

Declaration
public override bool DirectoryExists(string virtualDir)
Parameters
Type Name Description
System.String virtualDir

The virtual path

Returns
Type Description
System.Boolean

Dispose()

Declaration
public void Dispose()

Dispose(Boolean)

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

FileExists(String)

Checks if a file exists in the mapped path, otherwise fall back to the base implementation.

Declaration
public override bool FileExists(string virtualPath)
Parameters
Type Name Description
System.String virtualPath

The virtual path

Returns
Type Description
System.Boolean

True if the file exists; otherwise false

Finalize()

Declaration
protected override void Finalize()

GetCacheDependency(String, IEnumerable, DateTime)

Creates a cache dependency based on the specified virtual paths.

Declaration
public override CacheDependency GetCacheDependency(string virtualPath, IEnumerable virtualPathDependencies, DateTime utcStart)
Parameters
Type Name Description
System.String virtualPath

The path to the primary virtual resource.

System.Collections.IEnumerable virtualPathDependencies

An array of paths to other resources required by the primary virtual resource.

System.DateTime utcStart

The UTC time at which the virtual resources were read.

Returns
Type Description
System.Web.Caching.CacheDependency

A System.Web.Caching.CacheDependency object for the specified virtual resources.

GetCacheKey(String)

Returns a cache key to use for the specified virtual path.

Declaration
public override string GetCacheKey(string virtualPath)
Parameters
Type Name Description
System.String virtualPath

The path to the virtual resource.

Returns
Type Description
System.String

A cache key for the specified virtual resource.

GetDirectory(String)

Returns the virtual folder by given virtual directory path

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

The virtual path to the directory

Returns
Type Description
System.Web.Hosting.VirtualDirectory

GetFile(String)

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

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

Path to the file

Returns
Type Description
System.Web.Hosting.VirtualFile

A virtual file if one exists; otherwise null

GetFileHash(String, IEnumerable)

Returns the computed hash based on zipped file's name, creation time, modified time and uncompressed size

Declaration
public override string GetFileHash(string virtualPath, IEnumerable virtualPathDependencies)
Parameters
Type Name Description
System.String virtualPath

The virtual path of the file

System.Collections.IEnumerable virtualPathDependencies

List of dependant file paths

Returns
Type Description
System.String

Implements

System.IDisposable