Skip to main content

File Helper Utilities

The FileHelper library provides a set of methods for performing various file operations, such as reading, writing, copying, moving, renaming, deleting, and checking file properties. It is designed to streamline file handling within applications.

Library: ADS.FileIO.Helper

File Operations​

Service: FileHelper

1. AppendBinary​

void AppendBinary(string filePath, byte[] binaryContent);

Description:

Appends binary data to an existing file.

Parameters:

  • filePath (string) – The relative path of the file.
  • binaryContent (byte[]) – The binary data to append.

2. AppendText​

void AppendText(string filePath, string text);

Description:

Appends text to an existing file.

Parameters:

  • filePath (string) – The relative path of the file.
  • text (string) – The text to append.

3. Copy​

void Copy(string sourceFilePath, string destinationDirectory);

Description:

Copies a file to a specified destination directory.

Parameters:

  • sourceFilePath (string) – The relative path of the source file.
  • destinationDirectory (string) – The destination directory.

4. Move​

void Move(string sourceFilePath, string destinationDirectory);

Description:

Moves a file to a specified destination directory.

Parameters:

  • sourceFilePath (string) – The relative path of the source file.
  • destinationDirectory (string) – The destination directory.

5. Rename​

void Rename(string originalFilePath, string newFileName);

Description:

Renames an existing file.

Parameters:

  • originalFilePath (string) – The current file path.
  • newFileName (string) – The new file name.

6. Delete​

void Delete(string filePath);

Description:

Deletes a file.

Parameters:

  • filePath (string) – The relative path of the file.