on 08-25-2016 3:28 AM
Hi Gurus,
I need to ignore '#' character in file receiver adapter, Do you have any blog or idea to help me on this topic ?
Thanks in advance.
Regards,
Min Eng.
Hi Min Eng!
Do you have message mapping in your scenario? If so you could easily remove that characters within message mapping.
Regards, Evgeniy.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Min,
Adding to the Evgeniy's reply, If you have many fields in the input structure where this char needs to replace, then you can use the below code in "Attributes and Methods" in function tab of message mapping. Just replace the string with whatever char you want to replace.
public void transform(TransformationInput in, TransformationOutput out)
throws StreamTransformationException {
try {
String sourcexml = ""; String targetxml =""; String line ="";
InputStream ins = in.getInputPayload().getInputStream();
BufferedReader br = new BufferedReader( new InputStreamReader(ins));
while ((line = br.readLine()) != null)
sourcexml +=line+"\n";
br.close();
targetxml =sourcexml;
targetxml = targetxml.replaceAll("string", "");
out.getOutputPayload().getOutputStream().write(targetxml.getBytes());
} catch (Exception e) { throw new StreamTransformationException(e.getMessage()); }
}
regards,
Harish
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.