Table of Contents

Class FileNameExtensions

Namespace
DocuWare.Platform.ServerClient
Assembly
DocuWare.Platform.ServerClient.dll

A class to handle file name encoding

public static class FileNameExtensions
Inheritance
FileNameExtensions
Inherited Members

Methods

CreateCheckoutFileName(string, string, int)

Creates a name of the checkout file which contains the encoded document address.

public static string CreateCheckoutFileName(string fileName, string fileCabinetId, int docId)

Parameters

TypeNameDescription
stringfileName

Name of the file.

stringfileCabinetId

The file cabinet identifier.

intdocId

The document identifier.

Returns

TypeDescription
string

A file name which contains the address of the document.

DecodeCheckoutFileName(string, out string, out string, out int)

Strips the address of a checked out file from its name.

public static void DecodeCheckoutFileName(string encodedName, out string fileName, out string fileCabinetId, out int docId)

Parameters

TypeNameDescription
stringencodedName

Encoded name of the file.

stringfileName

Name of the file.

stringfileCabinetId

The file cabinet identifier.

intdocId

The document identifier.

Exceptions

TypeCondition
ArgumentException

The file name cannot be decoded by the checkin/checkout encoding/decoding rules.

MakeFileNameSane(string)

Makes the file name sane.

public static string MakeFileNameSane(string fileName)

Parameters

TypeNameDescription
stringfileName

Name of the file.

Returns

TypeDescription
string

The file name without not allowed characters.

Remarks

This function removes any not supported character from a file name.

TryDecodeCheckoutFileName(string, out string, out string, out int)

Tries decode the file name of a checkout file.

public static bool TryDecodeCheckoutFileName(string encodedName, out string fileName, out string fileCabinetId, out int docId)

Parameters

TypeNameDescription
stringencodedName

Name of the encoded.

stringfileName

Name of the file.

stringfileCabinetId

The file cabinet identifier.

intdocId

The document identifier.

Returns

TypeDescription
bool

True if the file name could be decoded. In this case the decoded parts of the file name is in the out parameters.