Skip to main content
Skip table of contents

File System Bulk

This adapter simplifies the use of file operations in Technical Processes. It allows to easily perform actions such as listing, moving, and copying multiple files or directories. The compatibility with the ZIP in Memory Compression adapter allows to easily (un)pack multiple files and directories.

Properties

Operation

Defines the operation executed by the adapter

Possible values:

  • Read: Read files
  • Write: Create/replace files and directories

  • Delete: Delete files and directories
  • GetMetadata: Read metadata from files and directories
  • Copy: Copy files and directories
  • Move: Move files and directories
  • List: List files and directories
  • ListAndRead: List files and directories and read the file contents at the same time (combines List with Read).
  • ListWithMetadata: List files and directories and read the metadata at the same time (combines List with GetMetadata)

Input and output structures of the File System Bulk adapter are compatible with the ZIP in Memory Compression adapter's structures.


Parameters

Adapter

Main adapter class (do not change!)

Possible values: de.softproject.integration.adapter.filesystem.Bulk: Main class (Default)

baseDirectory

Base directory for all operations.

(info) All operations work exclusively in this directory and its sub-directories.

Possible values: Absolute path to the base directory

subDirectory

Directory relative to the baseDirectory as basis for all operations.

Possible values:

  • <empty>: operations start within baseDirectory
  • .: operations start within baseDirectory
  • a: operations start within <baseDirectory>/a
  • .. or a/../..: Error, the baseDirectory can not be left this way
limit

Limits the amount of results returned by a list operation.

Possible values:

  • <positiveNumeber>: maximum number of returned results
  • 0: result is an empty list
  • <negativeNumber>: maximum number of results is unlimited


When searching for files, it is recommended to set the parameter skipDirectories to true, otherwise the desired matches for directories could be displaced.

maxLevel

Specifies the recursion depth for list operations.

Possible values:

  • <positiveNumber>: maximum depth a list operation is descending into directories
  • 1: only the direct content of the directory, which is specified by baseDirectory/subDirectory
  • 0: result is an empty list
  • <negativeNumber>: the recursion depth is unlimited
filter

Regular expression applied to the relative path of an entry in case of a list operation. If the regular expression applies, the path will be included in the result set of the list.

skipDirectories

Defines whether a list operation can return directory elements in the result.

Possible values:

  • true: directories won't show up in the result of list operations (helpful in combination with limit)
  • falsedirectories are included in the result of list operations
overwrite

Defines whether a WriteMove or Copy operation is allowed to overwrite existing files.

Possible values:

  • true: existing files may be overwritten with WriteCopy and Move
  • false: existing files mustn't be overwritten
strict

Defines whether parent directories have to exist for write operations, and a directory has to be empty in case of delete operations.

Possible values:

  • true:
    • The target directory to which is copied must exist for the operations Copy and Move.
    • The directories mus be empty for the operation Delete.
    • The target directory to which is written must exist for the operation Write.
  • false: The parent directories will be created for write operations. Moreover, directories will be deleted even if they are not yet empty.

Status values

1

All entries for the operation could be executed successfully.

0

Not all entries for the operation could be executed successfully, i.e. the result contains Error elements.

-1

Other technical problems occurred during the execution, e.g. invalid input.

Input

Input structure for Read, Write, GetMetadata and Delete

XML
<any>
 <!-- any mixture of file and directory elements -->
 <File name="relativePath">...Base64 content for Write...</File>
 <Directory name="relativePath" />
</any>

Input structure for Copy and Move

XML
<any>
 <!-- any mixture of file and firectory elements -->
 <File name="relativePath" target="relativePath" />
 <Directory name="relativePath" target="relativePath" />
</any>

Output

CODE
<Data>
  <!-- any mixture of file, directory and error elements -->
  <File name="relativePath" [size="size of file in bytes"]
      [creationTime=""] [creationTimeAsMillis=""]
      [lastModifiedTime=""] [lastModifiedTimeAsMillis=""]
      [lastAccessTime=""] [lastAccessTimeAsMillis=""]>
    <!-- base64 conten, if operation Read or ListAndRead -->
    <!-- xml structures containing metadata, if operation GetMetadata or ListWithMetadata -->
  </File>
  <Directory name="relativePath" [size="0"]
      [creationTime=""] [creationTimeAsMillis=""]
      [lastModifiedTime=""] [lastModifiedTimeAsMillis=""]
      [lastAccessTime=""] [lastAccessTimeAsMillis=""]>
    <!-- xml structures containing metadata, if operation GetMetadata or ListWithMetadata -->
  </Directory>
  <Error name="relativePath" [target="relativePath"] exception="fully qualified classname of exception"
      [size="size of file in bytes"]
      [creationTime=""] [creationTimeAsMillis=""]
      [lastModifiedTime=""] [lastModifiedTimeAsMillis=""]
      [lastAccessTime=""] [lastAccessTimeAsMillis=""]>
    <!-- base64 content, if operation Write -->
  </Error>
</Data>

Write, Delete, Copy and Move only have Error elements as result, if there have actually been errors.

Example for List

Prerequisites

The following directory structure is given:

JAVA
/
+ a/
| + index.html
| + logo.gif
| + content/
|   + toc.html
|   + page1.html
|   + page2.html
|   + images/
|     + pic1.png
|     + pic2.png
+ b/
  + some.html
  + other.html
  + files.html

Szenarios

List everything

Adapter configurationOutput
  • baseDirectory = /a
  • subDirectory =
  • limit = -1
  • maxLevel = -1
  • filter =
  • skipDirectories = false
XML
<Data>
  <File name="index.html" ... />
  <File name="logo.gif" ... />
  <Directory name="content" ... />
  <File name="content/toc.html" ... />
  <File name="content/page1.html" ... />
  <File name="content/page2.html" ... />
  <Directory name="content/images" ... />
  <File name="content/images/pic1.png" ... />
  <File name="content/images/pic2.png" ... />
</Data>

The first five entries

Adapter configurationOutput
  • baseDirectory = /a
  • subDirectory =
  • limit = 5
  • maxLevel = -1
  • filter =
  • skipDirectories = false
XML
<Data>
  <File name="index.html" ... />
  <File name="logo.gif" ... />
  <Directory name="content" ... />
  <File name="content/toc.html" ... />
  <File name="content/page1.html" ... />
</Data>

The first five files

Adapter configurationOutput
  • baseDirectory = /a
  • subDirectory =
  • limit = 5
  • maxLevel = -1
  • filter =
  • skipDirectories = true
XML
<Data>
  <File name="index.html" ... />
  <File name="logo.gif" ... />
  <File name="content/toc.html" ... />
  <File name="content/page1.html" ... />
  <File name="content/page2.html" ... />
</Data>

Only the current directory

Adapter configurationOutput
  • baseDirectory = /a
  • subDirectory =
  • limit = -1
  • maxLevel = 1
  • filter =
  • skipDirectories = false
XML
<Data>
  <File name="index.html" ... />
  <File name="logo.gif" ... />
  <Directory name="content" ... />
</Data>

All files and directories complying a filter

Adapter configuration

Output

  • baseDirectory = /a
  • subDirectory =
  • limit = -1
  • maxLevel = -1
  • filter = tent
  • skipDirectories = false
XML
<Data>
  <Directory name="content" ... />
  <File name="content/toc.html" ... />
  <File name="content/page1.html" ... />
  <File name="content/page2.html" ... />
  <Directory name="content/images" ... />
  <File name="content/images/pic1.png" ... />
  <File name="content/images/pic2.png" ... />
</Data>

All files complying a filter (without directories) 

Adapter configuration

Output

  • baseDirectory = /a
  • subDirectory =
  • limit = -1
  • maxLevel = -1
  • filter = tent
  • skipDirectories = true
XML
<Data>
  <File name="content/toc.html" ... />
  <File name="content/page1.html" ... />
  <File name="content/page2.html" ... />
  <File name="content/images/pic1.png" ... />
  <File name="content/images/pic2.png" ... />
</Data>

Everything beneath a subdirectory

Adapter configuration

Output

  •  baseDirectory = /a
  • subDirectory = content
  • limit = -1
  • maxLevel = -1
  • filter =
  • skipDirectories = false
XML
<Data>
  <File name="toc.html" ... />
  <File name="page1.html" ... />
  <File name="page2.html" ... />
  <Directory name="images" ... />
  <File name="images/pic1.png" ... />
  <File name="images/pic2.png" ... />
</Data> 

Everything beneath the current directory and the direct child directories

Adapter configuration

Output

  • baseDirectory = /a
  • subDirectory =
  • limit = -1
  • maxLevel = 2
  • filter =
  • skipDirectories = false
XML
 <Data>
  <File name="index.html" ... />
  <File name="logo.gif" ... />
  <Directory name="content" ... />
  <File name="content/toc.html" ... />
  <File name="content/page1.html" ... />
  <File name="content/page2.html" ... />
  <Directory name="content/images" ... />
</Data>

The start directory can be located at any depth within the directory

Adapter configuration

Output

  • baseDirectory = /a
  • subDirectory = content/images
  • limit = -1
  • maxLevel = -1
  • filter =
  • skipDirectories = false
XML
<Data>
  <File name="pic1.png" ... />
  <File name="pic2.png" ... />
</Data> 
JavaScript errors detected

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

If this problem persists, please contact our support.