PackageInfoVerifyLengthAndHashOfPackageZipFileInFolder Method |
Verifies the length and hash of package zip file. If length or hash differ, an exception is thrown.
Namespace: Altaxo.Serialization.AutoUpdatesAssembly: AltaxoBase (in AltaxoBase.dll) Version: 4.8.3261.0 (4.8.3261.0)
Syntax public FileStream? VerifyLengthAndHashOfPackageZipFileInFolder(
string storagePath,
bool leavePackageFileStreamOpen = false
)
Parameters
- storagePath String
- The full name of the directory where the package file can be found.
- leavePackageFileStreamOpen Boolean (Optional)
- If true, the file stream to the package file is left open.
You are responsible then for disposing the returned file stream.
Return Value
FileStreamIf the argument
leavePackageFileStreamOpen was true, the opened (read-only) stream of the package file.
You must not forget to dispose that stream. Otherwise, the return value is null.
Exceptions Exception | Condition |
---|
InvalidDataException |
The file {FileNameOfPackageZipFile} can't be found in directory {storagePath}
or
The downloaded file {fileInfo.FullName} has an unexpected length of {fileInfo.Length}. The expected value is {FileLength}
or
The downloaded file {fileInfo.FullName} has a different hash and is considered corrupted.
|
NotImplementedException | The downloaded file {fileInfo.FullName} was hashed with algorithm {HashName}, which is not implemented here. |
See Also