Class FileSerializer
Class that is used to convert dependency files from and to their native format into a serialized form that can be embedded in an XML file, XLIFF file, or file type definition.
Inheritance
Inherited Members
Namespace: Sdl.FileTypeSupport.Framework.Core.Settings
Assembly: Sdl.FileTypeSupport.Framework.Core.Settings.dll
Syntax
public static class FileSerializer
Methods
DeserializeFile(String)
Deserializes the file from a base-64 string
Declaration
public static DeserializeFileInfo DeserializeFile(string encodedFile)
Parameters
Type | Name | Description |
---|---|---|
System.String | encodedFile | The serialized file string |
Returns
Type | Description |
---|---|
DeserializeFileInfo | Information on the file and whether it was created successfully |
SerializeFile(FileInfo)
Serializes the file into a base-64 encoded string
Declaration
public static string SerializeFile(FileInfo file)
Parameters
Type | Name | Description |
---|---|---|
System.IO.FileInfo | file | The file to encode |
Returns
Type | Description |
---|---|
System.String | The serialized file string |
SerializeFile(String)
Serializes the file into a base-64 encoded string
Declaration
public static string SerializeFile(string filePath)
Parameters
Type | Name | Description |
---|---|---|
System.String | filePath | The path of the file to encode |
Returns
Type | Description |
---|---|
System.String | The serialized file string |
UnzipExternalFile(String)
Unzips a file
Declaration
public static DeserializeFileInfo UnzipExternalFile(string filePath)
Parameters
Type | Name | Description |
---|---|---|
System.String | filePath | The path to the zip file. |
Returns
Type | Description |
---|---|
DeserializeFileInfo | Information on the file and whether it was created successfully |
ZipExternalFile(String)
Compresses the file according to the zip standard to reduce the size of the encoded file.
Declaration
public static string ZipExternalFile(string filepath)
Parameters
Type | Name | Description |
---|---|---|
System.String | filepath | The path to the file that needs to be zipped |
Returns
Type | Description |
---|---|
System.String | The path to the zip file |