[resolved] how to rename input file

One Star

[resolved] how to rename input file

I have some input files in my local machine, after processing those files I need to rename the files. something like FILENAME.DONE or FILENAME.ERR
how this can be possible? any suggestions?

Accepted Solutions
Highlighted
One Star

Re: [resolved] how to rename input file

done by putting this code in tJava component
File file = new File(context.Directory+"\\"+ context.fileName);
File file2 = new File(context.Directory+"\\"+ context.fileName+".done");
file.renameTo(file2);

All Replies
Highlighted
One Star

Re: [resolved] how to rename input file

done by putting this code in tJava component
File file = new File(context.Directory+"\\"+ context.fileName);
File file2 = new File(context.Directory+"\\"+ context.fileName+".done");
file.renameTo(file2);

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Downloads and Trials

Test drive Talend's enterprise products.

Downloads