It is an application that prompts the user for a text string, performs a Web search (Google) and returns the title and URL of the first result.
- cd /projectDirectory
- ./start.sh
- The program asks u to enter text to search or to enter #quit for stopping
- Once u hit enter a web request will be made to https://www.google.com
- Upon success recieved html will be save in work/google.html file
- Then a parser will find 1st result and present it to u.
This is the maven project, so maven is required to complie it. For running maven isnt required, all libraries are already included.
mvn clean install
mvn dependency:copy-dependencies -Dmdep.useSubDirectoryPerScope=true
config directory contains two xml configuration files:
- logger.xml - logback configuration file
- httpClient.xml - apache http client configuration file
By defaul logs are written to logs/main.log file.
- weld-se is used to provide DI in se environment, its more powerful and flexible then Guice.
- lombok is a small library which generates setters\getters\toString and other helpful methods.
- slf4j allows to abstract from concrete logger implementation
- logback is a logger implementation, used by slf4j
- simple-xml is an easy to use xml serialization library
- apache http client open source, well documented apache library for making http requests, its better then HttpUrlConnection and has more features
- jsoup good library for parsing html, supports css queries and well documented