This simple Java application allows you to export data from an XML file to a Redis database. It reads a specific XML file (config.xml
), extracts data, and saves it to Redis keys according to predefined rules.
Before you begin, ensure you have met the following requirements:
- Docker and Docker Compose installed on your machine.
- A valid
config.xml
file containing the data you want to export.
To get started with this application, follow these steps:
-
Clone this repository to your local machine:
-
Navigate to the project directory:
-
Build the Docker image:
After building the Docker image, you can run the application with the following command:
Replace /path/to/config.xml
with the actual path to your XML file.
-
The application reads the XML file specified and exports data to Redis based on the following rules:
- The "subdomains" key contains a JSON array of all subdomains found in the XML.
- Keys of the format
cookie:%NAME%:%HOST%
contain the values of cookie elements in the XML.
-
If you include the
-v
flag when running the application, it will print all keys saved to Redis.
We have included unit tests to ensure the correctness of the XML parsing and data export logic. You can run the tests with the following command:
Contributions are welcome! If you have any improvements or bug fixes, feel free to submit a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.