on 08-22-2013 2:15 PM
Hi Experts
Currently i have a scenario where PI need to pick File from Sender folder and transfer (pass through or Binary transfer) to SFTP adapter(Advantco). I need to pick the file and zip it at the receiver place in the SFTP server. I am using AF_Modules/PayloadZipbean module for zip but i need the same filename as the sender in the receiver zip file name. So please suggest me how can i get the same file name. I am not using any IR objects for the interface. Can it be done with Standard without any custom modules.
Thanks&Regards
Rajesh Marupaka
Hi Rajesh,
In general custom adapter module is used to handle this - guidance can be found in the link below -
Although not an excellent way of doing this in mapping unless needed but you may want to try out the following approach if it suits you :
1) Add a Operation Mapping with dummy interfaces and Java Mapping to your scenario
2) The zipping of the file is done in the Java mapping which can be coded in the following lines :
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
.........
..........
byte[] buffer = new byte[1024];
ZipOutputStream zos = new ZipOutputStream(os);
ZipEntry ze= new ZipEntry("filename");
// os - outputstream in your mapping
// in - inputstream in your mapping
// retrieve the sender filename from DynamicConfiguration and put it above in place of filename.
zos.putNextEntry(ze);
.......
int len;
while ((len = in.read(buffer)) > 0) {
zos.write(buffer, 0, len);
}
in.close();
zos.closeEntry();
zos.close();
......
Regards
Subhro
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rajesh,
AFAIK, this is not possible.
Please also check the thread
http://scn.sap.com/thread/759529
Ambrish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
80 | |
9 | |
9 | |
7 | |
7 | |
6 | |
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.