Imagine i have .xml file with the below format.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<config>
<Directory>c:/test</Directory>
<headerLine>1</headerLine>
<pattern>.*\.txt</pattern>
</config>
The <Directory>
tag, Specify the path of the file.
The <headerLine>
tags, specify how many lines of my file have a header and the other is Body.(Not Important)
The <pattern>
tags. specify the Format of the files.
the question is:
i want to read a file. first of all, i have to go to <Directory>
tag, and get the directory of my files, then i have to read all of the files in that directory with the specify pattern, that shows in tags.
for example .in C:/test , i have many file, but i should read files, that terminated with ".*.txt" .
i use "Unmarshal" algorithm to read from .xml and convert it to java object.
my problem, is how can i defind to read all of the files in c:/test directory with that pattern.
could you please help me, how can i solve this problem?
FileSplitter fileSplitter = new FileSplitter("C:\\test.txt");
with this code, i can read just test.txt
file, but i want to read directories with specific pattern.