FileSystemRepositoryHelperGetFileSystemName Method (String, Int32, Int32) |
Gets file system safe representation of name. The resulting name does not exceed maxNameLength characters in length.
maxNameLength must accommodate hashLength and delimiting character.
Namespace: CMS.ContinuousIntegrationAssembly: CMS.ContinuousIntegration (in CMS.ContinuousIntegration.dll) Version: 12.0.0
Syntax public static string GetFileSystemName(
string name,
int maxNameLength,
int hashLength
)
Parameters
- name
- Type: SystemString
Name to be transformed to file system safe representation. - maxNameLength
- Type: SystemInt32
Max length of the resulting name. - hashLength
- Type: SystemInt32
Number of hash characters to be included in the resulting name, if hashing is needed.
Return Value
Type:
StringName in file system safe representation.
Exceptions Exception | Condition |
---|
ArgumentException | Thrown when name is null or empty. |
ArgumentOutOfRangeException | Thrown when hashLength is not a positive integer or maxNameLengthis not greater than (hash length + 1) - the extra character is for hash delimiter. |
Remarks
The name processing is similar to code name processing. Diacritics in Latin characters is removed,
illegal characters are replaced by '_' (underscore), multiple '.' (dot) are grouped to single '.',
leading and trailing '.' and '_' are trimmed.
See Also