C# 클래스 ZeroInstall.Store.Implementations.Archives.ArchiveExtractor

Extracts an archive.
상속: NanoByte.Common.Tasks.TaskBase, IDisposable
파일 보기 프로젝트 열기: 0install/0install-win 1 사용 예제들

Private Properties

프로퍼티 타입 설명
Create ArchiveExtractor
Create ArchiveExtractor
CreateHardlink void
GetRelativePath string
RemoveExecutableBit void
SetDirectoryWriteTimes void
SetExecutableBit void

공개 메소드들

메소드 설명
Dispose ( ) : void

Disposes the underlying Stream.

VerifySupport ( [ mimeType ) : void

Verifies that a archives of a specific MIME type are supported.

보호된 메소드들

메소드 설명
ArchiveExtractor ( [ target ) : System

Prepares to extract an archive contained in a stream.

CombinePath ( [ relativePath ) : string

Combines the extraction TargetDir path with the relative path inside the archive (ensuring only valid paths are returned).

CreateDirectory ( [ relativePath, System.DateTime lastWriteTime ) : void

Creates a directory in the filesystem and sets its last write time.

CreateSymlink ( [ source, [ target ) : void

Creates a symbolic link in the filesystem if possible; stores it in a FlagUtils.SymlinkFile otherwise.

Dispose ( bool disposing ) : void
Finish ( ) : void

Performs any tasks that were deferred to the end of the extraction process.

OpenFileWriteStream ( [ relativePath, bool executable = false ) : FileStream

Creates a stream for writing an extracted file to the filesystem.

QueueHardlink ( [ source, [ target, bool executable = false ) : void

Queues a hardlink for creation at the end of the extracton process. This enables handling links to files that have not been extracted yet.

StreamToFile ( [ stream, [ fileStream ) : void

Helper method for WriteFile.

Can be overwritten for archive formats that don't simply write a Stream to a file.

WriteFile ( [ relativePath, long fileSize, System.DateTime lastWriteTime, [ stream, bool executable = false ) : void

Writes a file to the filesystem and sets its last write time.

비공개 메소드들

메소드 설명
Create ( [ stream, [ target, [ mimeType ) : ArchiveExtractor
Create ( [ path, [ target, [ mimeType = null, long startOffset ) : ArchiveExtractor
CreateHardlink ( [ source, [ target ) : void

Creates a hardlink in the filesystem if possible; creates a copy otherwise.

GetRelativePath ( [ entryName ) : string
RemoveExecutableBit ( string relativePath ) : void

Marks a file as no longer executable using the filesystem if possible, an FlagUtils.XbitFile file otherwise.

SetDirectoryWriteTimes ( ) : void

Sets the last write times of the directories that were recorded during extraction.

This must be done in a separate step, since changing anything within a directory will affect its last write time.

SetExecutableBit ( string relativePath ) : void

Marks a file as executable using the filesystem if possible; stores it in a FlagUtils.XbitFile otherwise.

메소드 상세

ArchiveExtractor() 보호된 메소드

Prepares to extract an archive contained in a stream.
protected ArchiveExtractor ( [ target ) : System
target [ The path to the directory to extract into.
리턴 System

CombinePath() 보호된 메소드

Combines the extraction TargetDir path with the relative path inside the archive (ensuring only valid paths are returned).
is invalid (e.g. is absolute, points outside the archive's root, contains invalid characters).
protected CombinePath ( [ relativePath ) : string
relativePath [ A path relative to .
리턴 string

CreateDirectory() 보호된 메소드

Creates a directory in the filesystem and sets its last write time.
protected CreateDirectory ( [ relativePath, System.DateTime lastWriteTime ) : void
relativePath [ A path relative to .
lastWriteTime System.DateTime The last write time to set.
리턴 void

CreateSymlink() 보호된 메소드

Creates a symbolic link in the filesystem if possible; stores it in a FlagUtils.SymlinkFile otherwise.
protected CreateSymlink ( [ source, [ target ) : void
source [ A path relative to .
target [ The target the symbolic link shall point to relative to . May use non-native path separators!
리턴 void

Dispose() 공개 메소드

Disposes the underlying Stream.
public Dispose ( ) : void
리턴 void

Dispose() 보호된 추상적인 메소드

protected abstract Dispose ( bool disposing ) : void
disposing bool
리턴 void

Finish() 보호된 메소드

Performs any tasks that were deferred to the end of the extraction process.
protected Finish ( ) : void
리턴 void

OpenFileWriteStream() 보호된 메소드

Creates a stream for writing an extracted file to the filesystem.
protected OpenFileWriteStream ( [ relativePath, bool executable = false ) : FileStream
relativePath [ A path relative to .
executable bool true if the file's executable bit is set; false otherwise.
리턴 System.IO.FileStream

QueueHardlink() 보호된 메소드

Queues a hardlink for creation at the end of the extracton process. This enables handling links to files that have not been extracted yet.
protected QueueHardlink ( [ source, [ target, bool executable = false ) : void
source [ A path relative to .
target [ A path relative to .
executable bool true if the hardlink's executable bit is set; false otherwise.
리턴 void

StreamToFile() 보호된 메소드

Helper method for WriteFile.
Can be overwritten for archive formats that don't simply write a Stream to a file.
protected StreamToFile ( [ stream, [ fileStream ) : void
stream [ The stream to write to a file.
fileStream [ Stream access to the file to write.
리턴 void

VerifySupport() 공개 정적인 메소드

Verifies that a archives of a specific MIME type are supported.
The doesn't belong to a known and supported archive type or is null.
public static VerifySupport ( [ mimeType ) : void
mimeType [ The MIME type of archive format of the stream.
리턴 void

WriteFile() 보호된 메소드

Writes a file to the filesystem and sets its last write time.
protected WriteFile ( [ relativePath, long fileSize, System.DateTime lastWriteTime, [ stream, bool executable = false ) : void
relativePath [ A path relative to .
fileSize long The length of the zip entries uncompressed data, needed because stream's Length property is always 0.
lastWriteTime System.DateTime The last write time to set.
stream [ The stream containing the file data to be written.
executable bool true if the file's executable bit is set; false otherwise.
리턴 void