This is universal file downloader that can download URLS with HTTP and FTP protocol. It can be easily extended by extending the AbstractFileHandler class.
Support FTP, HTTP, HTTPS protocols
Download location can be modified using properties file
In order to execute the UniversalFileDownloader(UFD) you need to have JDK 8 installed.
The universalFileDownloader
has 3 artifacts:
It is responsible for downloading the file and saving it to the disk. New protocols can also be added in this artifact.
It is responsible for the business logic and threading
It is responsible for interacting with the database. This artifact use Hibernate to interact with DB.
ufd.core.api.downloadLocation
can be used to specify the downloading location. It is a relative path and files will be downloaded within the project directory.
ufd.core.api.generic.username
is used only for FTP protocol. In order to access public FTP remove this property from the properties file.
ufd.core.api.generic.password
is used only for FTP protocol. In order to access public FTP remove this property from the properties file.
The project uses an in-memory database by default and it is deleted every time the application is stopped. In order to use mySQL as database configure its properties in properties file.
After cloning the repository, import the project as Gradle project into the IDE. It will download the dependencies on import. Next, "BootGradleApplication.java" Run this file to launch the application.
UFD provides an easy to use dashboard. After you complete the starting process, the dashboard should be available on port 8080. Therefore, connecting to [http://localhost:8080] you should be able to access the dashboard.
A sample file name "Sample-Requests.txt" can be used for testing the application. It is located in src->main->resources
of the main project.