B
Bret Schuhmacher
Hi all,
I hope all you Java gurus that have been around the block a time or two can
answer this simple question.
What's the easiest way to read an XML properties file of relative
complexity? I know about Properties.readFromXML, but I don't think it'll
work on my semi-complex property file.
Here's my config file:
<DW>
<dir name="c:\x\y" subdirs="true">
<mask value="*.go">
<condition value="-*.go"/>
<operation value="encrypt"/>
<key value="key1"/>
<iv value="1234123412341234"/>
<mode value="AES/CBC/PKCS5Padding"/>
<etluser>
<etlpassword>
</mask>
<mask value="txt">
<condition value=">100k"/>
<operation value="encrypt"/>
<key value="key2"/>
<iv value="1234123413241234"/>
<mode value="AES/CBC/PKCS5Padding"/>
<etluser>
<etlpassword>
</mask>
</dir>
<dir name="c:\a\b\c" subdirs="true">
<mask value="*.txt">
<operation value="encrypt"/>
<key value="key3"/>
<iv value="6789678967896789"/>
<mode value="AES/CBC/PKCS5Padding"/>
<etluser>
<etlpassword>
</mask>
<mask value="*.enc">
<operation value="decrypt"/>
<key value="key4"/>
<iv value="1234123412341234"/>
<mode value="AES/CBC/PKCS5Padding"/>
<etluser>
<etlpassword>
</mask>
</dir>
</DW>
This is for a "DirectoryWatcher" program that will encrypt/decrypt files
that appear in the directories. I say it's semi-complex because the "dir"
element will have multiple occurrences, forming a list. So, too, does the
mask element - there are many masks to a "dir" element that I need brought
into the program as a list so I can iterate over the values.
I found http://easyconf.sourceforge.net. Are there other, better ways of
getting the values out of an XML config file other than parsing the doc
using DOM4J or equivalent?
Thanks,
Bret
I hope all you Java gurus that have been around the block a time or two can
answer this simple question.
What's the easiest way to read an XML properties file of relative
complexity? I know about Properties.readFromXML, but I don't think it'll
work on my semi-complex property file.
Here's my config file:
<DW>
<dir name="c:\x\y" subdirs="true">
<mask value="*.go">
<condition value="-*.go"/>
<operation value="encrypt"/>
<key value="key1"/>
<iv value="1234123412341234"/>
<mode value="AES/CBC/PKCS5Padding"/>
<etluser>
<etlpassword>
</mask>
<mask value="txt">
<condition value=">100k"/>
<operation value="encrypt"/>
<key value="key2"/>
<iv value="1234123413241234"/>
<mode value="AES/CBC/PKCS5Padding"/>
<etluser>
<etlpassword>
</mask>
</dir>
<dir name="c:\a\b\c" subdirs="true">
<mask value="*.txt">
<operation value="encrypt"/>
<key value="key3"/>
<iv value="6789678967896789"/>
<mode value="AES/CBC/PKCS5Padding"/>
<etluser>
<etlpassword>
</mask>
<mask value="*.enc">
<operation value="decrypt"/>
<key value="key4"/>
<iv value="1234123412341234"/>
<mode value="AES/CBC/PKCS5Padding"/>
<etluser>
<etlpassword>
</mask>
</dir>
</DW>
This is for a "DirectoryWatcher" program that will encrypt/decrypt files
that appear in the directories. I say it's semi-complex because the "dir"
element will have multiple occurrences, forming a list. So, too, does the
mask element - there are many masks to a "dir" element that I need brought
into the program as a list so I can iterate over the values.
I found http://easyconf.sourceforge.net. Are there other, better ways of
getting the values out of an XML config file other than parsing the doc
using DOM4J or equivalent?
Thanks,
Bret