Skip to main content
Skip table of contents

Handling of Directories

With the Filesystem adapter, you can write, read, remove directories and retrieve status information about a directory.

Directory Alias

Regarding directories, the Filesystem adapter can be configured with an directory alias. The Directory alias specifies a path to a directory and the default encoding for the contained files. You can use it for static directory access or to define a base path and encoding for file and directory handling (see also Static and Dynamic Filesystem Access below).

Creating a Directory

Using the createDirectory operation of the Filesystem adapter, you can create a new directory to the filesystem.

Name

Type

Direction

Description

name

String

in

Fully qualified file name of the directory you want to create, including the path.

When using the Windows style with backward slashes "\" you have to be aware that you need to escape this character. The escape character is also the "\".
To avoid this, use forward slashes with Windows as well.

The adapter call does not return any messages. If the directory already exists, no error will be reported. Neither the existing directory nor data within that directory will be affected in this case.

Removing a Directory

Removing an Empty Directory

Using the remove operation of the Filesystem adapter on a directory, you can delete an empty directory from the filesystem.

Name

Type

Direction

Description

name

String

in

Fully qualified file name of the directory you want to remove, including the path.

When using the Windows style with backward slashes "\" you have to be aware that you need to escape this character. The escape character is also the "\".
To avoid this, use forward slashes with Windows as well.

You can only remove empty directories using remove. In case the directory is not empty, use removeRecursively (see below).

Removing a Directory and all its Contents

Using the removeRecursively operation of the Filesystem adapter, you can delete a directory and all its contents from the filesystem.

Name

Type

Direction

Description

name

String

in

Fully qualified file name of the top node of the directory tree you want to remove, including the path.

When using the Windows style with backward slashes "\" you have to be aware that you need to escape this character. The escape character is also the "\".
To avoid this, use forward slashes with Windows as well.

Reading the Contents of a Directory

Using the readDirectory operation of the Filesystem adapter, you can get a list of the contents of a directory in the filesystem.

Name

Type

Direction

Description

name

String

in

Fully qualified path to the directory you want to read.

When using the Windows style with backward slashes "\" you have to be aware that you need to escape this character. The escape character is also the "\".
To avoid this, use forward slashes with Windows as well.

entries

Array of String

out

readDirectory returns an array of String containing the names of the content elements. The array elements do not contain the directory prefix (path).

Retrieving Directory Information

Using the status operation of the Filesystem adapter on a directory, you can get some general information on the directory.

Name

Type

Direction

Description

name

String

in

Fully qualified file name of the file/directory you want to read, including the path.

When using the Windows style with backward slashes "\" you have to be aware that you need to escape this character. The escape character is also the "\".
To avoid this, use forward slashes with Windows as well.

size

Integer

out

Size of the file in Bytes.

size is meaningless for directories, as it is not the combined size of all contained files and subfolders, but rather some constant defined by the operating system (e.g. 0 or 4096).

type

String

out

Type of accessed element (File or Directory).

accessTime

DateTime

out

Timestamp when the file/directory was accessed for the last time.

creationTime

DateTime

out

Timestamp when the file/directory was created.

modificationTime

DateTime

out

Timestamp when the file/directory was modified for the last time.

Static and Dynamic Filesystem Access

You can use the Filesystem Adapter in three ways: statically, dynamically, and in a mixed mode between both.

Item

Description

Static

Static access means that the path to the file/directory is defined statically to the service via an alias. Every time you use an operation of the Filesystem adapter, you need to select the related alias on the operation. The attributes of the alias are static within a service but can be changed in the service settings.

Dynamic

Dynamic file access means that the path to the file/directory has to be provided manually via input parameters for every usage of an operation of the Filesystem adapter.

Mixed

You can also mix static and dynamic file access. All attributes that have been assigned to an adapter call via the related alias can still be overwritten manually. Or, you can configure only some attributes on the alias, and provide others dynamically.
This way, you can e.g. specify a base directory using a DirectoryAlias, and write different files to that directory. Or, specify a default encoding and write different files.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.