C# Class ICSharpCode.SharpZipLib.Zip.ZipNameTransform

ZipNameTransform transforms names as per the Zip file naming convention.
The use of absolute names is supported although its use is not valid according to Zip naming conventions, and should not be used if maximum compatability is desired.
Inheritance: INameTransform
Exibir arquivo Open project: icsharpcode/SharpZipLib Class Usage Examples

Public Methods

Method Description
IsValidName ( string name ) : bool

Test a name to see if it is a valid name for a zip entry.

Zip path names are actually in unix format, and should only contain relative paths if a path is present. This means that the path stored should not contain a drive or device letter, or a leading slash. All slashes should forward slashes '/'. An empty name is valid where the input comes from standard input. A null name is not considered valid.

IsValidName ( string name, bool relaxed ) : bool

Test a name to see if it is a valid name for a zip entry.

Zip path names are actually in Unix format, and should only contain relative paths. This means that any path stored should not contain a drive or device letter, or a leading slash. All slashes should forward slashes '/'. An empty name is valid for a file where the input comes from standard input. A null name is not considered valid.

TransformDirectory ( string name ) : string

Transform a windows directory name according to the Zip file naming conventions.

TransformFile ( string name ) : string

Transform a windows file name according to the Zip file naming conventions.

ZipNameTransform ( string trimPrefix ) : System

Initialize a new instance of

Private Methods

Method Description
MakeValidName ( string name, char replacement ) : string

Force a name to be valid by replacing invalid characters with a fixed value

ZipNameTransform ( ) : System

Static constructor.

Method Details

IsValidName() public static method

Test a name to see if it is a valid name for a zip entry.
Zip path names are actually in unix format, and should only contain relative paths if a path is present. This means that the path stored should not contain a drive or device letter, or a leading slash. All slashes should forward slashes '/'. An empty name is valid where the input comes from standard input. A null name is not considered valid.
public static IsValidName ( string name ) : bool
name string The name to test.
return bool

IsValidName() public static method

Test a name to see if it is a valid name for a zip entry.
Zip path names are actually in Unix format, and should only contain relative paths. This means that any path stored should not contain a drive or device letter, or a leading slash. All slashes should forward slashes '/'. An empty name is valid for a file where the input comes from standard input. A null name is not considered valid.
public static IsValidName ( string name, bool relaxed ) : bool
name string The name to test.
relaxed bool If true checking is relaxed about windows file names and absolute paths.
return bool

TransformDirectory() public method

Transform a windows directory name according to the Zip file naming conventions.
public TransformDirectory ( string name ) : string
name string The directory name to transform.
return string

TransformFile() public method

Transform a windows file name according to the Zip file naming conventions.
public TransformFile ( string name ) : string
name string The file name to transform.
return string

ZipNameTransform() public method

Initialize a new instance of
public ZipNameTransform ( string trimPrefix ) : System
trimPrefix string The string to trim from the front of paths if found.
return System