I've a ear file conatining many war files and jar files in it. Will Splunk be able to search the contents of the folder that contains the list of file names and also will it be possible to search the contents within the files as well?
Splunk does support some archiving formats, but sadly not the ones you mention here. From the documentation at http://docs.splunk.com/Documentation/Splunk/6.0.2/Data/Monitorfilesanddirectories:
Splunk decompresses archive files before it indexes them. It can handle these common archive file types: tar, gz, bz2, tar.gz, tgz, tbz, tbz2, zip, and z.