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
| Type | Name | Description |
|---|---|---|
| string | fileName | Name of the file. |
| string | fileCabinetId | The file cabinet identifier. |
| int | docId | The document identifier. |
Returns
| Type | Description |
|---|---|
| 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
| Type | Name | Description |
|---|---|---|
| string | encodedName | Encoded name of the file. |
| string | fileName | Name of the file. |
| string | fileCabinetId | The file cabinet identifier. |
| int | docId | The document identifier. |
Exceptions
| Type | Condition |
|---|---|
| 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
| Type | Name | Description |
|---|---|---|
| string | fileName | Name of the file. |
Returns
| Type | Description |
|---|---|
| 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
| Type | Name | Description |
|---|---|---|
| string | encodedName | Name of the encoded. |
| string | fileName | Name of the file. |
| string | fileCabinetId | The file cabinet identifier. |
| int | docId | The document identifier. |
Returns
| Type | Description |
|---|---|
| bool |
|