Creates the directory and its subsequent sub-directories with the path specified in the argument.
| Arguments: |
|
|---|---|
| Return-type : | java.lang.String |
| Returns: | The directory path that was created. |
Example:
=DIR_CREATE("C:/AdapChain/test_dir/test_io")
In the above example, the directory test_dir is created with its sub-directory test_io under the directory C:\AdapChain\.
Deletes the directory (including its sub-directories) specified by the path in the argument.
| Arguments: |
|
|---|---|
| Return-type : | java.lang.Boolean |
| Returns: | Returns boolean false if the directory does not exist else true if the directory gets deleted successfully. |
Example:
=DIR_DELETE("C:/AdapChain/test_dir/test")
The above example deletes the directory test including its sub-directories.
Generates a new directory under a parent directory and returns the new directory name.
| Arguments: |
|
|---|---|
| Return-type : | java.lang.String |
| Returns: | The new directory path which is generated. |
Example:
=DIR_GENERATE("C:/AdapChain/test_dir", "ad", "p")
=DIR_GENERATE("C:/AdapChain/test_dir", "ad", "p")
The above RBA assignments generates directories with the following names:
Gets a list of file or directory objects under a directory.
| Arguments: |
|
|---|---|
| Return-type : | ITERATOR<String> |
| Returns: | An iterator pointing to list of files, directories or both. |
Example:
Following is the way to get a list of all the files under the directory C:/AdapChain/test_dir_source while creating a RBA family:
LoopAt Iterator : =DIR_LIST("C:/AdapChain/test_dir_source", "*", true)
=> Into Object : T_DIR_LIST
The files can be retrieved from the variable T_DIR_LIST while looping over the family.
Changes a directory name to a new name. Returns the new directory path.
| Arguments: |
|
|---|---|
| Return-type : | java.lang.String |
| Returns: | The new directory path after renaming. |
Example:
Following example shows how to rename a directory test_dir to test_dir1:
=DIR_RENAME("C:/AdapChain/test_dir", "C:/AdapChain/test_dir1")
Copies a file from one location to a different directory.
| Arguments: |
|
|---|---|
| Return-type : | java.lang.String |
| Returns: | Destination directory path. |
Example:
=FILE_COPY_TO_DIR("C:/AdapChain/test_dir_source/test.txt", "C:/AdapChain/test_dir_target", true)
The RBA assignments in the above example shows the copying of file test.txt to the directory C:/AdapChain/test_dir_target and removes the source file after copying it.
Copies a file from one location to a different path with a same or different name.
| Arguments: |
|
|---|---|
| Return-type : | java.lang.String |
| Returns: | Destination file path after copying. |
Example:
=FILE_COPY_TO_FILE("C:/AdapChain/test_dir_source/test.txt", "C:/AdapChain/test_dir_target/test_target.txt", true)
The RBA assignments in the above example shows the copying of file test.txt to the directory C:/AdapChain/test_dir_target as test_target.txt and removes the source file after copying it.
Deletes a file specified by the path in the argument. Returns boolean false if the file does not exist else true if the file gets deleted successfully.
| Arguments: |
|
|---|---|
| Return-type : | java.lang.Boolean |
| Returns: | Boolean false if the file does not exist else true if the file gets deleted successfully. |
Example:
=FILE_DELETE("C:/AdapChain/test_dir/test/test.txt")
The above example deletes the file test.txt.
Generates a new file under a directory and returns the new file path. Returns the new file path.
| Arguments: |
|
|---|---|
| Return-type : | java.lang.String |
| Returns: | The new file path. |
Example:
=FILE_GENERATE("C:/AdapChain/test_dir_source", "test", "b.tsv")
=FILE_GENERATE("C:/AdapChain/test_dir_source", "test", "b.tsv")
The above RBA assignments create the following files in the directory C:/AdapChain/test_dir_source:
Reads a file line wise and retrieves it as string.
| Arguments: |
|
|---|---|
| Return-type : | ITERATOR<String> |
| Returns: | An iterator that can be used to loop over the lines in the input file. |
Example:
Following is the way to get an iterator over the lines in file source_file.txt while creating a RBA family.
LoopAt Iterator : =FILE_READ_LINES("C:/AdapChain/test_dir_source/source_file.txt")
=> Into Object : T_LINE_FILE
The lines can be retrieved from the variable T_LINE_FILE anytime while looping over the family.
Changes a file name to a new name. Returns the new file path.
| Arguments: |
|
|---|---|
| Return-type : | java.lang.String |
| Returns: | The new file path after renaming. |
Example:
Following example shows how to rename a file testA.txt to testB.txt:
=FILE_RENAME("C:/AdapChain/test_dir/testA.txt", "C:/AdapChain/test_dir/testB.txt")
Gives the string representation of a file.
| Arguments: |
|
|---|---|
| Return-type : | java.lang.String |
| Returns: | The string representation of a file. |
Example:
T_STRING = FILE_TO_STRING("C:/AdapChain/test_dir_source/test.txt")
The above assignment assigns the string representation of file test.txt to the variable T_STRING.
Returns the normalized value of the input path i.e.:
| Arguments: |
|
|---|---|
| Return-type : | java.lang.String |
| Returns: | Returns the normalized path value. |
Example:
=PATH_NORMALIZE("C:\AdapChain\AdapLink service\..")
Output: "C:/AdapChain"
Resolves the final path for a given parent path and relative child path.
| Arguments: |
|
|---|---|
| Return-type : | java.lang.String |
| Returns: | Returns the normalized path value. |
Example:
=PATH("C:\AdapChain", "backup")
Output: "C:\AdapChain\backup" - The directory separator is automatically added
=PATH("C:\AdapChain\", "backup")
Output: "C:\AdapChain\backup" - The directory separator is not added twice
=PATH("C:\AdapChain\AdapLink service\..", "backup", true)
Output: "C:/AdapChain/backup"
Downloads an URL to local file system in a directory. Returns the file path after downloading the URL.
| Arguments: |
|
|---|---|
| Return-type : | java.lang.String |
| Returns: | The file path after downloading the URL. |
Example:
=URL_DOWNLOAD_TO_DIR("http://www.adapchain.com", "C:/AdapChain/test_dir_target", "index.html")
The above RBA assignment downloads the html index file from the URL “http://www.adapchain.com” and saves it as index.html under the directory C:/AdapChain/test_dir_target in local system.
Downloads an URL to local file system as a file. Returns the file path after downloading the URL.
| Arguments: |
|
|---|---|
| Return-type : | java.lang.String |
| Returns: | The file path after downloading the URL. |
Example:
=URL_DOWNLOAD_TO_FILE("http://www.adapchain.com", "C:/AdapChain/test_dir_target/index.html")
The above RBA assignment downloads the html index file from the URL “http://www.adapchain.com” and saves it as C:/AdapChain/test_dir_target/index.html in local system.