Codeunit 18122353 EOS004 IFileSystem Wrapper

Codeunit 18122353 EOS004 IFileSystem Wrapper

Provides access to different types of file systems implemented via IFileSystem.

Methods

Initialize

procedure Initialize(ifc: Interface "EOS004 IFileSystem")

Initializes a new instance. This must be called before any other method from this codeunit is called. This overload can be used if the underlying IFileSystem implementation does not require any configuration or has already been configured.

Parameters / Return Value

  • ifc Interface "EOS004 IFileSystem"

    The IFileSystem interface to use.


Initialize

procedure Initialize(ifc: Interface "EOS004 IFileSystem"; ServiceConfigCode: Code[20])

Initializes a new instance. This must be called before any other method from this codeunit is called.

Parameters / Return Value

  • ifc Interface "EOS004 IFileSystem"

    The IFileSystem interface to use.

  • ServiceConfigCode Code[20]

    The configuration for the IFileSystem.


Initialize

procedure Initialize(ifc: Interface "EOS004 IFileSystem"; ServiceConfig: Record "EOS004 Service Config.")

Initializes a new instance. This must be called before any other method from this codeunit is called.

Parameters / Return Value

  • ifc Interface "EOS004 IFileSystem"

    The IFileSystem interface to use.

  • ServiceConfig Record "EOS004 Service Config."

    The configuration for the IFileSystem.


UploadFile

procedure UploadFile(path: Text; var TempBlob: codeunit "Temp Blob")

Uploads a file to the file system. This is a TryFunction.

Parameters / Return Value

  • path Text[]

    The path to the folder where the file should be placed.

  • TempBlob codeunit "Temp Blob"

    The contents of the file to be uploaded.


NormalizeFolderDelimiter

procedure NormalizeFolderDelimiter(Path: Text): Text

Normalizes the folder delimiter on a given path, if different delimiters are used.

Parameters / Return Value

  • Path Text[]

    The path to be normalized.

  • Returns Text[]


GetFolderDelimiter

procedure GetFolderDelimiter(Path: Text): Text

Returns the folder delimiter used on a given path.

Parameters / Return Value

  • Path Text[]

    The path

  • Returns Text[]

    The folder delimiter.


GetParentPath

procedure GetParentPath(Path: Text): Text

Returns the parent path of a given path.

Parameters / Return Value

  • Path Text[]

    The path.

  • Returns Text[]

    The parent path. Will be an empty string if the path is the root or first element.


GetChildName

procedure GetChildName(Path: Text): Text

Returns the name of the last element (file or folder) of a path.

Parameters / Return Value

  • Path Text[]

    The path.

  • Returns Text[]

    The name of the last element (file or folder). Will be an empty string if the path is the root.


FileExists

procedure FileExists(path: Text; var Exists: Boolean)

Checks if a file exists on the file system. This is a TryFunction.

Parameters / Return Value

  • path Text[]

    The fully qualified path to the file.

  • Exists Boolean

    Will contain true if the file exists, false otherwise.


FolderExists

procedure FolderExists(path: Text; var Exists: Boolean)

Checks if a folder exists on the file system. This is a TryFunction.

Parameters / Return Value

  • path Text[]

    The fully qualified path to the folder.

  • Exists Boolean

    Will contain true if the file exists, false otherwise.


ReadFile

procedure ReadFile(path: Text; var TempBlob: codeunit "Temp Blob")

Reads the contents of a file into the provided BLOB. This is a TryFunction.

Parameters / Return Value

  • path Text[]

    The fully qualified path to the file.

  • TempBlob codeunit "Temp Blob"

    Will contain the contents of the file.


DeleteFile

procedure DeleteFile(path: Text)

Deletes a file from the file system. This is a TryFunction.

Parameters / Return Value

  • path Text[]

    The fully qualified path to the file.


RenameFile

procedure RenameFile(oldPath: Text; newPath: Text)

Renames a file on the file system. This is a TryFunction.

Parameters / Return Value

  • oldPath Text[]

    The fully qualified path to the file to be renamed.

  • newPath Text[]

    The fully qualified path to the new file.


CopyFile

procedure CopyFile(fromPath: Text; toPath: Text)

Copies a file on the file system. This is a TryFunction.

Parameters / Return Value

  • fromPath Text[]

  • toPath Text[]


MoveFile

procedure MoveFile(fromPath: Text; toPath: Text)

Moves a file on the file system. This is a TryFunction.

Parameters / Return Value

  • fromPath Text[]

  • toPath Text[]


GetFiles

procedure GetFiles(path: Text; var TempEntries: Record "EOS004 AzFS Entry")

Returns a list of files in a fiven folder on the file system. This is a TryFunction.

Parameters / Return Value

  • path Text[]

    The fully qualified path to the folder to be queried.

  • TempEntries Record "EOS004 AzFS Entry"

    This will contain the found file system entries.


GetFiles

procedure GetFiles(path: Text; var TempEntries: Record "EOS004 AzFS Entry"; ClearBuffer: Boolean)

Returns a list of files in a fiven folder on the file system. This is a TryFunction.

Parameters / Return Value

  • path Text[]

    The fully qualified path to the folder to be queried.

  • TempEntries Record "EOS004 AzFS Entry"

    This will contain the found file system entries.

  • ClearBuffer Boolean

    If true, the buffer will be cleared before adding new entries.


GetFileAttributes

procedure GetFileAttributes(path: Text; var Result: Dictionary of [Text, Text])

Returns the attributes of a file system entry. This is a TryFunction.

Parameters / Return Value

  • path Text[]

    The fully qualified path to the file to be queried.

  • Result Dictionary[Text,Text]

    This will contain all the attributes of the file from the file system. The actual attributes returned are specific to the IFileSystem implementation in use and may vary between implementations.


CreateFolder

procedure CreateFolder(path: Text)

Creates a folder on the filesystem. This is a TryFunction.

Parameters / Return Value

  • path Text[]

    The fully qualified path on the FileSystem.


DeleteFolder

procedure DeleteFolder(path: Text; force: Boolean)

Deletes an entire folder tree on the filesystem. This also recursively deletes children. This is a TryFunction.

Parameters / Return Value

  • path Text[]

    The fully qualified path on the FileSystem.

  • force Boolean


MoveFolder

procedure MoveFolder(fromPath: Text; toPath: Text)

Moves an entire folder tree on the filesystem. This is a TryFunction.

Parameters / Return Value

  • fromPath Text[]

    The fully qualified path to the folder to be moved.

  • toPath Text[]

    The fully qualified path to the new folder.



EOS Labs -