The file library provides the following classes:
Article number/class name |
Class Name
Swrba_File
List of Methods
Method | Description |
String receive_file(String hostname, String username, String password, String source, String destination, String ostype) | Acquire the file from the specified host. "Success" is returned if acquisition was successful. An exception is returned if acquisition failed. |
String send_file(String hostname, String username, String password, String source, String destination, String ostype) | Transfer files to the specified host. "Success" is returned if transfer was successful. An exception is returned if transfer failed. |
Integer return_code() | Return the return value of the file acquisition/transfer results. |
Input Information
hostname Specify the host name or IP address.
username Specify the name of the user using SSH to connect to the host acquiring or transferring the file.
If the operation component connects with the file transfer infrastructure, the connected user name will be fixed at either of the following names and cannot be changed. In this case, the user name is ignored even if specified.
- If the Business Server is running on Windows: Administrator
- If the Business Server is running on Linux: root
password Specify the password of the user using SSH to connect to the host acquiring or transferring the file.
If the operation component connects with the file transfer infrastructure, the password is ignored even if specified.
source Specify the name of the file that is the acquisition source.
destination Specify the name of the file that is the acquisition destination.
ostypeSpecify the operating system of the host acquiring or transferring the file.
Notes
If the information except for the Management Server has been entered for "hostname", this library uses the file transfer infrastructure or SSH communication to perform its operations. Set either at least to be able to communicate. Refer to the "3.16 Notes of Each Communication Method" for the notes of each communication method.
For the name of the file for which the access permissions are to be changed, use only alphanumeric characters and the following symbols.
Symbols that can be used: "!", "~", "_", "-", ".".
If a file exists in the transfer destination that has the same name as the file specified in "destination", the file is overwritten.
When using this library to create operation components, make sure that the management server installation directory does not contain whitespace characters or the result cannot be guaranteed.
File Location
Windows | <Installation directory>\SWRBAM\rbaope\bin\parts\lib\ standard\swrba_file.rb |
Linux | /opt/FJSVswrbam/rbaope/bin/parts/lib/standard/swrba_file.rb |
Class Name
Swrba_File
List of Methods
Method | Description |
String change_file_authority(String hostname, String username, String password, String execusername, String execpassword, String filename, String ownerauthority, String groupauthority, String otherauthority, String ostype) | Change the access permissions for the file on the specified host. "Success" is returned if access permissions were changed successfully. An exception is returned if access permissions failed to be changed. |
Integer return_code() | Return the return value of the results of changing access permissions. |
Input Information
hostname Specify the host name or IP address.
username Specify the name of the user using SSH to connect to the host where the file whose access permissions are to be changed resides.
If the operation component connects with the file transfer infrastructure, the connected user name will be fixed at either of the following names and cannot be changed. In this case, the user name is ignored even if specified.
- If the Business Server is running on Windows: Administrator
- If the Business Server is running on Linux: root
password Specify the password of the user using SSH to connect to the host where the file whose access permissions are to be changed resides.
If the operation component connects with the file transfer infrastructure, the password is ignored even if specified.
filename Specify the name of the file whose access permissions are to be changed.
ownerauthoritySpecify the access permission for the owner of the file. Specify execute (X), read (R), write (W), or cancel all (C) permissions.
If the access permissions for a file are changed using the file transfer infrastructure and the file is in a Windows environment, the file attributes will be changed.
groupauthority Specify the access permission for the group that owns the file. Specify execute (X), read (R), write (W), or cancel all (C)permissions.
If the access permissions for a file are changed and the file is in a Windows environment, the specified content does not take effect.
otherauthoritySpecify the access permission for other users of the file. Specify execute (X), read (R), write (W), or cancel all (C)permissions.
If the access permissions for a file are changed and the file is in a Windows environment, the specified content does not take effect.
execusername Specify the name of the user whose file access permissions are to be changed.
If the host specified by the "hostname" option is running on Windows and the connection is made using the file transfer infrastructure, execute the command as an administrator. In this case, the user name is ignored even if specified.
execpassword This library does not use the value of "execpassword".
The value of "execpassword" is ignored even if specified.
ostypeSpecify the operating system of the host where the file whose access permissions are to be changed resides.
Notes
If the information except for the Management Server has been entered for "hostname", this library uses the file transfer infrastructure or SSH communication to perform its operations. Set either at least to be able to communicate. Refer to the "3.16 Notes of Each Communication Method" for the notes of each communication method.
If the connected user and executing user are different, refer to the "3.16.7 Notes When Connected User And Executing User Are Different".
Use alphanumeric characters and the following symbols for the names of the files to which access permissions are changed.
Symbols that can be used: "!", "~", "_", "-", ".".
File Location
Windows | <Installation directory>\SWRBAM\rbaope\bin\parts\lib\ standard\swrba_file.rb |
Linux | /opt/FJSVswrbam/rbaope//bin/parts/lib/standard/swrba_file.rb |
Class Name
Swrba_File
List of Methods
Method | Description |
String search_file(String hostname, String username, String password, String filename, String ostype, String execusername, String execpassword) | Confirm whether the specified file exists in the specified host. "Success" is returned if the file existence confirmation is successful. An exception is returned if the file existence confirmation failed. |
Integer return_code() | Return the return value of the file existence confirmation results. |
Input Information
hostname Specify the host name or IP address.
username Specify the name of the user using SSH to connect to the host confirming the existence of the file.
If the operation component connects with the file transfer infrastructure, the connected user name will be fixed at either of the following names and cannot be changed. In this case, the user name is ignored even if specified.
- If the Business Server is running on Windows: Administrator
- If the Business Server is running on Linux: root
password Specify the password of the user using SSH to connect to the host confirming the existence of the file.
If the operation component connects with the file transfer infrastructure, the password is ignored even if specified.
filenameSpecify the name of the file whose existence is to be confirmed.
ostypeSpecify the operating system of the host confirming the existence of the file.
execusername Specify the name of the user confirming the existence of the file.
If the host specified by the "hostname" option is running on Windows and the connection is made using the file transfer infrastructure, execute the command as an administrator. In this case, the user name is ignored even if specified.
execpassword This library does not use the value of "execpassword".
The value of "execpassword" is ignored even if specified.
Notes
If the information except for the Management Server has been entered for 'hostname', this library uses the file transfer infrastructure or SSH communication to perform its operations. Set either at least to be able to communicate. Refer to the "3.16 Notes of Each Communication Method" for the notes of each communication method.
If the connected user and executing user are different, refer to the "3.16.7 Notes When Connected User And Executing User Are Different".
Use alphanumeric characters and the following symbols for the names of the files to be confirmed existence.
Symbols that can be used: "!", "~", "_", "-", ".".
File Location
Windows | <Installation directory>\SWRBAM\rbaope\bin\parts\lib\ standard\swrba_file.rb |
Linux | /opt/FJSVswrbam/rbaope/bin/parts/lib/standard/swrba_file.rb |
Class Name
Swrba_File
List of Methods
Method | Description |
String make_file(String hostname, String username, String password, String filename, String text, String overwrite, String ostype, String exec_username, String exec_password) | Make text files to the specified host.. "Success" is returned if the file making was successful. An exception is returned if the file making failed. |
String delete_file(String hostname, String username, String password, String filename, String ostype, String exec_username, String exec_password) | Delete files from the specified host. "Success" is returned if the file deletion was successful. An exception is returned if the file deletion failed. |
Integer return_code() | Return the return value of the file making or deletion results. |
Input Information
hostname Specify the host name or IP address.
username Specify the name of the user using SSH to connect to the host making or deleting the file.
If the operation component connects with the file transfer infrastructure, the connected user name will be fixed at either of the following names and cannot be changed. In this case, the user name is ignored even if specified.
- If the Business Server is running on Windows: Administrator
- If the Business Server is running on Linux: root
password Specify the password of the user using SSH to connect to the host making or deleting the file.
If the operation component connects with the file transfer infrastructure, the password is ignored even if specified.
filenameSpecify the name of the file to be created or deleted.
textSpecify the text string written to the file to be created.
overwriteSpecify whether to overwrite if the file already exists.
Specify off(do not overwrite) or on(overwrite).
ostypeSpecify the operating system of the host making or deleting the file.
exec_username Specify the name of the user making or deleting the file.
If the host specified by the "hostname" option is running on Windows and the connection is made using the file transfer infrastructure, execute the command as an administrator. In this case, the user name is ignored even if specified.
exec_password This library does not use the value of "exec password".
The value of "exec password" is ignored even if specified.
Notes
If the information except for the Management Server has been entered for "hostname", this library uses the file transfer infrastructure or SSH communication to perform its operations. Set either at least to be able to communicate. Refer to the "3.16 Notes of Each Communication Method" for the notes of each communication method.
If the connected user and executing user are different, refer to the "3.16.7 Notes When Connected User And Executing User Are Different".
For the file where the string is to be added, specify a text file that uses appropriate character encoding, as listed in the following table.
Host containing the file where the string is to be added | Character encoding of the text file |
---|---|
Windows Management Server | CHARACTER ENCODING SPECIFIED BY THE LANG ENVIRONMENT VARIABLE |
Linux Management Server | UTF-8 |
Windows Linked Server or Business Server | CHARACTER ENCODING SPECIFIED BY THE LANG ENVIRONMENT VARIABLE |
Linux Linked Server or Business Server | Character encoding specified by the LANG environment variable |
Use alphanumeric characters and the following symbols for the names of the file to be created or be deleted.
Symbols that can be used: "!", "~", "_", "-", ".".
File Location
Windows | <Installation directory>\SWRBAM\rbaope\bin\parts\lib\ standard\swrba_file.rb |
Linux | /opt/FJSVswrbam/rbaope/bin/parts/lib/standard/swrba_file.rb |
Class Name
Swrba_File
List of Methods
Method | Description |
String add_string(String hostname, String username, String password, String filename, String addstring, String outputfile, String overwrite, String ostype, String execusername, String execpassword) | Add the text strings to the text file on the specified host. "Success" is returned if the text strings were added to the file successfully. An exception is returned if text strings failed to be added in the file. |
Integer return_code() | Return the return value of the results of adding text strings to the file. |
Input Information
hostname Specify the host name or IP address.
username Specify the name of the user using SSH to connect to the host containing the file to which the character string needs to be added.
If the operation component connects with the file transfer infrastructure, the connected user name will be fixed at either of the following names and cannot be changed. In this case, the user name is ignored even if specified.
- If the Business Server is running on Windows: Administrator
- If the Business Server is running on Linux: root
password Specify the password of the user using SSH to connect to the host containing the file to which the character string needs to be added.
If the operation component connects with the file transfer infrastructure, the password is ignored even if specified.
filename Specify the name of the file to which the string is to be added.
addstring Specify the character string that will be added to the file.
outputfile Specify the name of the file that will output the result of adding the string to the file.
overwrite Specify whether to overwrite if the "outputfile" already exists.
Specify off(do not overwrite) or on(overwrite).
ostype Specify the operating system of the host containing the file to which the character string is to be added.
execusername Specify the name of the user who creates the file.
If the host specified by the "hostname" option is running on Windows and the connection is made using the file transfer infrastructure, execute the command as an administrator. In this case, the user name is ignored even if specified.
execpassword This library does not use the value of "execpassword".
The value of "execpassword" will be ignored even if specified.
Notes
If the information except for the Management Server has been entered for "hostname", this library uses the file transfer infrastructure or SSH communication to perform its operations. Set either at least to be able to communicate. Refer to the "3.16 Notes of Each Communication Method" for the notes of each communication method.
If the connected user and executing user are different, refer to the "3.16.7 Notes When Connected User And Executing User Are Different".
For the file to which the string is to be added, specify a text file that uses appropriate character encoding, as listed in the following table.
Host containing the file to which the string is to be added | Character encoding of the text file |
---|---|
Windows Management Server | CHARACTER ENCODING SPECIFIED BY THE LANG ENVIRONMENT VARIABLE |
Linux Management Server | UTF-8 |
Windows Linked Server or Business Server | CHARACTER ENCODING SPECIFIED BY THE LANG ENVIRONMENT VARIABLE |
Linux Linked Server or Business Server | Character encoding specified by the LANG environment variable |
Use alphanumeric characters and the following symbols for the names of the files to be created.
Symbols that can be used: "!", "~", "_", "-", ".".
File Location
Windows | <Installation directory>\SWRBAM\rbaope\bin\parts\lib\ standard\swrba_file.rb |
Linux | /opt/FJSVswrbam/rbaope/bin/parts/lib/standard/swrba_file.rb |
Class Name
Swrba_File
List of Methods
Method | Description |
String copy_file(String hostname, String username, String password, String sourcefilename, String destination, String overwrite, String ostype, String execusername, String execpassword) | Copy files on the specified host. "Success" is returned if the file copy was successful. An exception is returned if the file copy failed. |
String move_file(String hostname, String username, String password, String sourcefilename, String destination, String overwrite, String ostype, String execusername, String execpassword) | Move files on the specified host. "Success" is returned if the file movement was successful. An exception is returned if the file movement failed. |
Integer return_code() | Return the return value of the file copy or movement results. |
Input Information
hostname Specify the host name or IP address.
usernameSpecify the name of the user using SSH to connect to the host copying or moving the file.
If the operation component connects with the file transfer infrastructure, the connected user name will be fixed at either of the following names and cannot be changed. In this case, the user name is ignored even if specified.
- If the Business Server is running on Windows: Administrator
- If the Business Server is running on Linux: root
passwordSpecify the password of the user using SSH to connect to the host copying or moving the file.
If the operation component connects with the file transfer infrastructure, the password is ignored even if specified.
sourcefilenameSpecify the name of the file that is the copy or movement source.
destinationSpecify the name of the file or directory that is the copy or movement destination.
overwriteSpecify whether to overwrite if the file already exists.
ostypeSpecify the operating system of the host copying or moving the file.
execusername Specify the name of the user copying or moving the file.
If the host specified by the "hostname" option is running on Windows and the connection is made using the file transfer infrastructure, execute the command as an administrator. In this case, the user name is ignored even if specified.
execpassword This library does not use the value of "execpassword".
The value of "execpassword" is ignored even if specified.
Notes
If the information except for the Management Server has been entered for "hostname", this library uses the file transfer infrastructure or SSH communication to perform its operations. Set either at least to be able to communicate. Refer to the "3.16 Notes of Each Communication Method" for the notes of each communication method.
If the connected user and executing user are different, refer to the "3.16.7 Notes When Connected User And Executing User Are Different".
Use alphanumeric characters and the following symbols for the names of the files to be copied or moved.
Symbols that can be used: "!", "~", "_", "-", ".".
File Location
Windows | <Installation directory>\SWRBAM\rbaope\bin\parts\lib\ standard\swrba_file.rb |
Linux | /opt/FJSVswrbam/rbaope/bin/parts/lib/standard/swrba_file.rb |
Class Name
Swrba_File
List of Methods
Method | Description |
String compress_file(String hostname, String username, String password, String compfilename, String filename, String overwrite, String ostype, String execusername, String execpassword) | Compress files on the specified host. The compressed format is zip form. "Success" is returned if the file compression was successful. An exception is returned if the file compression failed. |
String decompress_file(String hostname, String username, String password, String compfilename, String directoryname, String ostype, String execusername, String execpassword)s | Decompress files on the specified host. The compressed format of a possible decompression is zip form. "Success" is returned if the file decompression was successful. An exception is returned if the file decompression failed. |
Integer return_code() | Return the return value of the file compression or decompression results. |
Input Information
hostnameSpecify the host name or IP address.
usernameSpecify the name of the user using SSH to connect to the host compressing or decompressing the file.
If the operation component connects with the file transfer infrastructure, the connected user name will be fixed at either of the following names and cannot be changed. In this case, the user name is ignored even if specified.
- If the Business Server is running on Windows: Administrator
- If the Business Server is running on Linux: root
passwordSpecify the password of the user using SSH to connect to the host compressing or decompressing the file.
If the operation component connects with the file transfer infrastructure, the password is ignored even if specified.
compfilenameSpecify the name of the compressed file.
filenameSpecify the name of the file to be compressed.
directorynameSpecify the name of the decompress destination directory.
overwriteSpecify whether to overwrite if a compressed file already exists.
ostypeSpecify the operating system of the host compressing or decompressing the file.
execusernameSpecify the name of the user compressing or decompressing the file.
If the host specified by the "hostname" option is running on Windows and the connection is made using the file transfer infrastructure, execute the command as an administrator. In this case, the user name is ignored even if specified.
execpasswordThis library does not use the value of "execpassword".
The value of "execpassword" is ignored even if specified.
Notes
If the information except for the Management Server has been entered for "hostname", this library uses the file transfer infrastructure or SSH communication to perform its operations. Set either at least to be able to communicate. Refer to the "3.16 Notes of Each Communication Method" for the notes of each communication method.
If the connected user and executing user are different, refer to the "3.16.7 Notes When Connected User And Executing User Are Different".
Use alphanumeric characters and the following symbols for the names of the files to be compressed or decompressed.
Symbols that can be used: "!", "~", "_", "-", ".".
File Location
Windows | <Installation directory>\SWRBAM\rbaope\bin\parts\lib\ standard\swrba_file.rb |
Linux | /opt/FJSVswrbam/rbaope/bin/parts/lib/standard/swrba_file.rb |
Class Name
Swrba_File
List of Methods
Method | Description |
String change_file_encoding(String searchfile, String outputfile, String character_encoding, String from_encoding, String overwrite) | Convert the character code of the files on the specified host. "Success" is returned if the character code conversion was successful. An exception is returned if the character code conversion failed. |
Integer return_code() | Return the return value of the result of the character code conversion. |
Input Information
searchfile Specify the name of the file whose character code is to be converted.
outputfile Specify the name of the file that that will output the result of the conversion.
from_encoding Specify the character code before conversion.
character_encoding Specify the character code after conversion.
overwrite Specify whether to overwrite if the file that outputs the result already exists.
Notes
Use alphanumeric characters and the following symbols for the names of the files to be encoded.
Symbols that can be used: "!", "~", "_", "-", ".".
File Location
Windows | <Installation directory>\SWRBAM\rbaope\bin\parts\lib\ standard\swrba_file.rb |
Linux | /opt/FJSVswrbam/rbaope/bin/parts/lib/standard/swrba_file.rb |
Class Name
Swrba_File
List of Methods
Method | Description |
String search_file_character_string(String hostname, String username, String password, String searchfile, String searchstring, String outputmode, String searchscope, String searchmode, String exclusionsearch, String outputfile, String overwrite, String ostype, String execusername, String execpassword) | Search for text strings in text files on the specified host. "Success" is returned if the text string search was successful. An exception is returned if the text string search failed. |
Integer return_code() | Return the return value of the result that the specified text string was searched. |
Input Information
hostname Specify the host name or IP address.
username Specify the name of the user using SSH to connect to the host containing the file whose character string is to be searched.
If the operation component connects with the file transfer infrastructure, the connected user name will be fixed at either of the following names and cannot be changed. In this case, the user name is ignored even if specified.
- If the Business Server is running on Windows: Administrator
- If the Business Server is running on Linux: root
password Specify the password of the user using SSH to connect to the host containing the file whose character string is to be searched.
If the operation component connects with the file transfer infrastructure, the password is ignored even if specified.
searchfile Specify the file name containing the character string to be searched.
searchstring Specify the string to be searched.
outputmode Specify the format for the search result or output. Specify line(line number is output), text(content of the line is output), all(line number and content of the line are output).
searchscope Specify the search range of the character string within the file.
Separate the start position and end position numbers with a hyphen (-).
If the starting position is omitted, the first character of the file becomes the starting position.
If the end position is omitted, the last character of the file becomes the end position.
If the starting position and end position are omitted, the entire file is searched.
(example) If you search the 20th line from the 10th line: 10-20
If you search the 20th line from the head of the file: -20
If you search from the 10th line to the end of the file: 10-
searchmode Specify the search method for the string. Specify first (search till the first occurrence of the string) or all (search the entire range).
exclusionsearch Specify whether to use the exclusive search. Specify off(normal search) or on(exclusive search).
outputfile Specify the name of the file that will output the search result.
overwrite Specify whether to overwrite if the "outputfile" already exists.
Specify off(do not overwrite) or on(overwrite).
ostype Specify the operating system of the host containing the file with the character string to be searched.
execusername Specify the name of the user searching the character string on the host where the file exists.
If the host specified by the "hostname" option is running on Windows and the connection is made using the file transfer infrastructure, execute the command as an administrator. In this case, the user name is ignored even if specified.
execpassword This library does not use the value of "execpassword".
The value of "execpassword" is ignored even if specified.
Notes
If the information except for the Management Server has been entered for "hostname", this library uses the file transfer infrastructure or SSH communication to perform its operations. Set either at least to be able to communicate. Refer to the "3.16 Notes of Each Communication Method" for the notes of each communication method.
If the connected user and executing user are different, refer to the "3.16.7 Notes When Connected User And Executing User Are Different".
For the file whose string is to be searched, specify a text file that uses appropriate character encoding, as listed in the following table.
Host containing the file whose string is to be searched | Character encoding of the text file |
---|---|
Windows Management Server | CHARACTER ENCODING SPECIFIED BY THE LANG ENVIRONMENT VARIABLE |
Linux Management Server | UTF-8 |
Windows Linked Server or Business Server | CHARACTER ENCODING SPECIFIED BY THE LANG ENVIRONMENT VARIABLE |
Linux Linked Server or Business Server | Character encoding specified by the LANG environment variable |
Use alphanumeric characters and the following symbols for the name of the file that text strings are searched.
Symbols that can be used: "!", "~", "_", "-", ".".
File Location
Windows | <Installation directory>\SWRBAM\rbaope\bin\parts\lib\ standard\swrba_file.rb |
Linux | /opt/FJSVswrbam/rbaope/bin/parts/lib/standard/swrba_file.rb |
Class Name
Swrba_File
List of Methods
Method | Description |
String replace_file_character_string(String hostname, String username, String password, String searchfile, String searchstring,String replacestring String outputfile, String overwrite, String ostype, String execusername, String execpassword) | Replace text strings in text files on the specified host. "Success" is returned if the text string replacement was successful. An exception is returned if the text string replacement failed. |
Integer return_code() | Return the return value of the result that the specified text string was searched. |
Input Information
hostname Specify the host name or IP address.
username Specify the name of the user using SSH to connect to the host containing the file to replace the character string.
If the operation component connects with the file transfer infrastructure, the connected user name will be fixed at either of the following names and cannot be changed. In this case, the user name is ignored even if specified.
- If the Business Server is running on Windows: Administrator
- If the Business Server is running on Linux: root
password Specify the password of the user using SSH to connect to the host containing the file whose character string is to be replaced.
If the operation component connects with the file transfer infrastructure, the password is ignored even if specified.
searchfile Specify the file name containing the character string to be replaced.
searchstring Specify the string to be replaced.
replacestring Specify the string after replacement.
outputfile Specify the name of the file that will output the result of the character string replacement.
overwrite Specify whether to overwrite if the "outputfile" already exists.
Specify off(do not overwrite), on(overwrite).
ostype Specify the operating system of the host containing the file whose character string is to be replaced.
execusername Specify the name of the user replacing the character string on the host where the file exists.
If the host specified by the "hostname" option is running on Windows and the connection is made using the file transfer infrastructure, execute the command as an administrator. In this case, the user name is ignored even if specified.
execpassword This library does not use the value of "execpassword".
The value of "execpassword" is ignored even if specified.
Notes
If the information except for the Management Server has been entered for "hostname", this library uses the file transfer infrastructure or SSH communication to perform its operations. Set either at least to be able to communicate. Refer to the "3.16 Notes of Each Communication Method" for the notes of each communication method.
If the connected user and executing user are different, refer to the "3.16.7 Notes When Connected User And Executing User Are Different".
For the file whose string is to be replaced, specify a text file that uses appropriate character encoding, as listed in the following table.
Host containing the file with the string to be replaced | Character encoding of the text file |
---|---|
Windows Management Server | CHARACTER ENCODING SPECIFIED BY THE LANG ENVIRONMENT VARIABLE |
Linux Management Server | UTF-8 |
Windows Linked Server or Business Server | CHARACTER ENCODING SPECIFIED BY THE LANG ENVIRONMENT VARIABLE |
Linux Linked Server or Business Server | Character encoding specified by the LANG environment variable |
Use alphanumeric characters and the following symbols for the name of the file that text strings are replaced.
Symbols that can be used: "!", "~", "_", "-", ".".
File Location
Windows | <Installation directory>\SWRBAM\rbaope\bin\parts\lib\ standard\swrba_file.rb |
Linux | /opt/FJSVswrbam/rbaope/bin/parts/lib/standard/swrba_file.rb |