Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Karuetl
Creator II
Creator II

downloading all files from S3

I tried using tS3List-->tS3Get components 

 

in tS3list I gave the bucket name and the key prefix. Under this folder, there are multiple files 

Key prefix as below 

/folder/export=2019/

 in tS3Get component for Key i gave as below 

 

((String)globalMap.get("tS3List_1_CURRENT_KEY"))

 File: as below 

/folder/work/

The problem here is if I include as File as below, it creates the folder inside from the current_key 

 

"/folder/work/" + ((String)globalMap.get("tS3List_1_CURRENT_KEY"))

it creates as below

/folder/work/folder/export=2019/a.json

my expectation is as below 

/folder/work/a.json
Labels (1)
1 Solution

Accepted Solutions
nfz11
Creator III
Creator III

You could do a string replace to remove the key prefix text:

 

String keyPrefix = "/folder/export=2019/";
"/folder/work/" + ((String)globalMap.get("tS3List_1_CURRENT_KEY")).replaceAll(keyPrefix,"");

 

View solution in original post

1 Reply
nfz11
Creator III
Creator III

You could do a string replace to remove the key prefix text:

 

String keyPrefix = "/folder/export=2019/";
"/folder/work/" + ((String)globalMap.get("tS3List_1_CURRENT_KEY")).replaceAll(keyPrefix,"");