Class ZipStorageProvider
Represents virtual storage provider over zip file.
public sealed class ZipStorageProvider : AbstractStorageProvider
- Inheritance
-
objectZipStorageProvider
- Inherited Members
- Extension Methods
Remarks
Provider is read-only virtual file system, allowing to get files as ZipFileStream.
Constructors
ZipStorageProvider(string, string, AbstractStorageProvider)
Constructor
public ZipStorageProvider(string zipFilePath, string mappedPath, AbstractStorageProvider parentProvider)
Parameters
zipFilePathstringPath to the zip file
mappedPathstringMapped path
parentProviderAbstractStorageProviderParent storage provider
Fields
ZIP_END
Ending character for the zip archive within path
public const char ZIP_END = ']'
Field Value
- char
ZIP_START
Starting character for the zip archive within path
public const char ZIP_START = '['
Field Value
- char
Properties
CacheData
If true, the loaded data is cached
public bool CacheData { get; set; }
Property Value
- bool
CacheDataLimit
Limit size for the caching of the file data (bytes)
public int CacheDataLimit { get; set; }
Property Value
- int
FilePath
Zip file path
public string FilePath { get; }
Property Value
- string
Name
Provider name
public override string Name { get; }
Property Value
- string
RootDirectory
Root directory
public ZipDirectoryInfo RootDirectory { get; }
Property Value
ZipFile
Zip file info object
public FileInfo ZipFile { get; }
Property Value
Methods
CreateDirectoryProviderObject()
Creates new directory provider object
protected override AbstractDirectory CreateDirectoryProviderObject()
Returns
CreateFileProviderObject()
Creates new directory provider object
protected override AbstractFile CreateFileProviderObject()
Returns
Dispose()
Releases all resources used by the current instance of the ZipStorageProvider class.
public void Dispose()
Dispose(string)
Disposes the storage provider for the given path
public static void Dispose(string path)
Parameters
pathstring
DisposeAll(Func<string, bool>)
Disposes the zip storage providers
public static void DisposeAll(Func<string, bool> pathCondition = null)
Parameters
pathConditionFunc<string, bool>Path condition
GetDirectoryInfo(string)
Returns new instance of directory info.
public override DirectoryInfo GetDirectoryInfo(string path)
Parameters
pathstringPath
Returns
GetFileData(string)
Gets the particular file data
public byte[] GetFileData(string fileName)
Parameters
fileNamestringFile name
Returns
- byte[]
GetFileInfo(string)
Returns new instance of FileInfo object.
public override FileInfo GetFileInfo(string fileName)
Parameters
fileNamestringFile name
Returns
GetFileStream(string)
Gets a file stream for the given file
public Stream GetFileStream(string fileName)
Parameters
fileNamestringFile name
Returns
- Stream
GetFileStream(string, FileMode)
Returns new instance of file stream.
public override FileStream GetFileStream(string path, FileMode mode)
Parameters
pathstringPath to file
modeFileModeFile mode
Returns
GetFileStream(string, FileMode, FileAccess)
Returns new instance of file stream.
public override FileStream GetFileStream(string path, FileMode mode, FileAccess access)
Parameters
pathstringPath to file
modeFileModeFile mode
accessFileAccessFile access
Returns
GetFileStream(string, FileMode, FileAccess, FileShare)
Returns new instance of file stream.
public override FileStream GetFileStream(string path, FileMode mode, FileAccess access, FileShare share)
Parameters
pathstringPath to file
modeFileModeFile mode
accessFileAccessFile access
shareFileShareSharing permissions
Returns
GetFileStream(string, FileMode, FileAccess, FileShare, int)
Returns new instance of file stream.
public override FileStream GetFileStream(string path, FileMode mode, FileAccess access, FileShare share, int bufferSize)
Parameters
pathstringPath to file
modeFileModeFile mode
accessFileAccessFile access
shareFileShareSharing permissions
bufferSizeintBuffer size
Returns
GetZipFileName(string)
Gets the zip file name with the container brackets
public static string GetZipFileName(string fileName)
Parameters
fileNamestringFile name
Returns
- string
IsZipFolderPath(string)
Gets the zip file path from the given zip folder path. Returns null if the path isn't a zip folder path
public static bool IsZipFolderPath(string path)
Parameters
pathstring
Returns
- bool