Interact with Files in File Server
You can obtain a list of files, write or move a file to File Server, get the reference of a file and then stage read or unzip the file, and delete a file on File Server using the File server action.
On This Page
- What You Can Do with the File Server Action
- When Not to Use the File Server Action
- Start Here: Add the File Server Action to an Integration
- Option 1. Obtain a List of Files in File Server
- Option 2. Write a File to File Server
- Option 3. Move a File to File Server
- Option 4. Stage a File and Work with It, or Write a File to Another Location in File Server
- Option 5. Delete a File in File Server
- Next Steps
What You Can Do with the File Server Action
The File server action lets you interact with files in the following ways.
For all of the options, you can hard code values, but most of the time, you'll pass dynamic values into the File server action using the Map action. Complete that task after you finish defining the File server action. See Next Steps.
Goal | Operation to use | Step-by-step instructions |
---|---|---|
Obtain a list of files in a File Server directory |
List directory |
|
Create a new file in a File Server directory |
Write File |
|
Move a file from one File Server directory to another (similar to a cut and paste operation) |
Move File |
|
Get a reference to a file in a File Server director, and use the reference to complete either of the following tasks:
|
Get File Reference |
|
Encrypt or decrypt a file |
You can also use the capabilities of the FTP Adapter to encrypt or decrypt a file. |
Alternatively, to use the FTP Adapter to encrypt or decrypt a file, see Create a Connection and Add the FTP Adapter Connection to an Integration in Using the FTP Adapter with Oracle Integration 3. |
Sign or verify a file |
You can perform signing using the private key to allow the receiver to verify that the file contents were not altered during transit. You can also perform signature verification using the public key on the incoming file to verify that the contents were not altered during transit.
|
Alternatively, to use the FTP Adapter to perform file signing or verification, see Create a Connection and Add the FTP Adapter Connection to an Integration in Using the FTP Adapter with Oracle Integration 3. |
Delete a file in a File Server directory |
Delete File |
When Not to Use the File Server Action
If you need to write a file to a temporary storage location and then perform work on the file, such as by updating the file, use a connection that is based on the FTP Adapter, or use the stage file action.
Start Here: Add the File Server Action to an Integration
No matter what you need to use the File server action to do, start here by adding the action to your integration.
-
Add a File server action to an integration in either of the following ways:
- On the side of the canvas, click
Actions
and drag the File server action to the appropriate location.
- Click
at the location where you want to add the assign action, then select File server.
Note:
If you don't see the File server action or can't add it to an integration, then an administrator needs to enable File Server for your Oracle Integration instance. See Enable File Server in Using File Server in Oracle Integration 3. - On the side of the canvas, click
Actions
-
Fill in the following fields.
Field Description What do you want to call your endpoint? Name of the endpoint, such as write_file_to_File_Server. Select resource Select one of the following options:
-
File: Interact with a file, such as by writing, moving, downloading, reading, or deleting it.
-
Directory: Obtain a list of files in a specific directory in File Server.
Additional fields, which are related to the operation that you selected, appear.
-
-
Continue following the steps in the appropriate section:
Option 1. Obtain a List of Files in File Server
-
Complete the steps in Start Here: Add the File Server Action to an Integration.
-
From the Select operation drop-down list, select List directory.
-
Fill in the following fields.
Field Description Can override later in the mapper? Input Directory Name of the directory that contains the files that you need to list. Oracle recommends using an absolute directory.
For example,
/HOME/USERS/
.Yes File name pattern Pattern of the files that you want to list, such as *.csv for only CSV files. Or, enter * to list files of all types. Yes Max Files Maximum number of files to return, up to 1000.
Note: The File server action returns the files according to the last modified time. If you selected 10 as the maximum number of files and the last modified time of the eleventh file is the same as the tenth file, then the action also returns the eleventh file and any other files with the same last modified time. For example, consider a directory with 15 files, and the Max Files setting is 10. If the tenth, eleventh, twelfth, and thirteenth files have the same time stamp, then the File server action returns thirteen files.
No Minimum Age (seconds) Minimum age in seconds of the files to return.
For example, if a file was last modified at 02:28:45 AM, and the minimum age is 80 seconds, the file isn't returned at 02:29:00 AM and 02:30:00 AM. The file is returned only after 02:30:05.
No List File Recursively Whether to list files within directories recursively beneath the input directory. No -
Select Continue.
-
Review the summary of the action, and select Finish.
The File server action appears on the canvas with a Map action before it.
Option 2. Write a File to File Server
-
Complete the steps in Start Here: Add the File Server Action to an Integration.
-
From the Select operation drop-down list, select Write File.
-
Fill in the following fields.
Field Description Can override later in the mapper? Specify an Output Directory Name of the directory to write the files to. Oracle recommends using an absolute directory.
For example,
/HOME/USERS/
.Yes File Name Name of the file to create. Yes -
Select Continue.
-
Review the summary of the action, and select Finish.
The File server action appears on the canvas with a Map action before it.
Option 3. Move a File to File Server
-
Complete the steps in Start Here: Add the File Server Action to an Integration.
-
From the Select operation drop-down list, select Move File.
-
Fill in the following fields.
Field Description Can override later in the mapper? Directory path Name of the directory that contains the file to be moved. Oracle recommends using an absolute directory.
For example,
/HOME/USERS/
.Yes File name Name of the file to be moved. The file can be of any size. If the file is missing, an error occurs when the integration attempts to locate it. Yes Target directory path Name of the directory to move the file to. Oracle recommends using an absolute directory.
For example,
/HOME/USERS/
.If the directory doesn't exist, File Server creates it.
Yes Target file name Name of the file in the target directory. Yes Overwrite File When selected, the target file is overwritten if it already exists.
If you deselect this option and the file already exists in the target directory, an error occurs when File Server attempts to move the file to the directory.
No -
Select Continue.
-
Review the summary of the action, and select Finish.
The File server action appears on the canvas with a Map action before it.
Option 4. Stage a File and Work with It, or Write a File to Another Location in File Server
This operation gets a reference to a file in File Server. If anyone moves or deletes the file while the integration is running, an error occurs, indicating that the file doesn't exist.
-
Complete the steps in Start Here: Add the File Server Action to an Integration.
-
From the Select operation drop-down list, select Get File Reference.
-
Fill in the following fields.
Field Description Can override later in the mapper? Input Directory Name of the directory that contains the files that you need to download. Oracle recommends using an absolute directory.
For example,
/HOME/USERS/
.Yes File Name Name of the file in the input directory. Yes -
Select Continue.
-
Review the summary of the action, and select Finish.
The File server action appears on the canvas with a Map action before it.
Option 5. Delete a File in File Server
-
Complete the steps in Start Here: Add the File Server Action to an Integration.
-
From the Select operation drop-down list, select Delete File.
-
Fill in the following fields:
Field Description Can override later in the mapper? Directory path Name of the directory to delete. Oracle recommends using an absolute directory.
For example,
/HOME/USERS/
.Yes File name Name of the file to delete. Yes -
Select Continue.
-
Review the summary of the action, and select Finish.
The File server action appears on the canvas with a Map action before it.
Note that the activity stream doesn't detect the file size, so the file size always appears as 0 in the activity stream for deleted files.
Next Steps
-
Pass dynamic values into the File server action using the Map action, which appears before the File server action on the canvas. See About Mapping Data Between Applications in Using the Oracle Mapper with Oracle Integration 3.
-
If you need to encrypt a file and then write it to File Server, perform the following steps:
-
After the File server action, add a stage file action to encrypt the file.
See Process Files in Schedule Integrations with a Stage File Action.
-
After the stage file action, add another File server action using the Write File operation. This action uploads the file to File Server by passing the encrypted file reference.
Alternatively, use the FTP Adapter to encrypt the file and write it to File Server. See Create a Connection and Add the FTP Adapter Connection to an Integration in Using the FTP Adapter with Oracle Integration 3.
-
-
If you need to decrypt a file that is in File Server, use the stage file action or the FTP Adapter. See the following links:
-
Process Files in Schedule Integrations with a Stage File Action
-
Create a Connection and Add the FTP Adapter Connection to an Integration in Using the FTP Adapter with Oracle Integration 3
-