Reputation: 153
Using a file operation in java, I can copy or append content of one file into another file; however, my situation is little bit different. I do not want to copy or append the contents of a file into another. I want to refer the content of one file into another.
I need something along the lines of transclusion which is working for me in Java. I need to be able to include or exclude content of a file whenever I want instead of appending or removing content manually each time using file operation.
By the way, my file is pure txt file. How can I perform this task in java?
Upvotes: 1
Views: 144
Reputation: 299048
I think the most elegant way to solve such a requirement is to have a look at a templating technology like Velocity or FreeMarker. Both should have native support for File inclusion.
Upvotes: 1