02-27-2024 3:35 PM - edited 02-27-2024 3:36 PM
Hi Team,
can anyone throw some thoughts on how to retain the filename coming from AzureStorage sender adapter and send it to S4 (SFTP)
i tried using content modifier and groovy scripts but not able to get the expected result.
Under Exchange properties i am getting as below
Lock Name | Mass_Order_Participant_19gfpaqj9fptegx7vbaacpbh/MassOrderUpload/testtxtfile.txt |
i need to capture testtxtfile.txt
Any thoughts?
try this groovy script assuming that the complete file name path is stored in the exchange property completePath
import com.sap.gateway.ip.core.customdev.util.Message;
import java.util.HashMap;
def Message processData(Message message) {
//Body
def body = message.getBody();
//Properties
def properties = message.getProperties();
completePath = properties.get("completePath");
//split fullname
String[] vCompletePath;
vCompletePath = completePath.split('/');
//set properties
message.setProperty("filename", vCompletePath[vCompletePath.length-1]);
return message;
}
Alex
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Alex,
your solution worked thank you.
I have another question , what if the blob path places different filenames like below
1234_massorder.txt
5678_massorder.txt
how to define my path in content modifier exchange property.
as of now i defined as Mass_Order_Participant_19gfpaqj9fptegx7vbaacpbh/MassOrderUpload/testtxtfile.txt
Input
Mass_Order_Participant_19gfpaqj9fptegx7vbaacpbh/MassOrderUpload/1234_massorder.txt
Mass_Order_Participant_19gfpaqj9fptegx7vbaacpbh/MassOrderUpload/5678_massorder.txt
Output
1234_massorder.txt
5678_massorder.txt
User | Count |
---|---|
77 | |
9 | |
9 | |
7 | |
7 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.